I want to match with a pattern all anchor tags containing "goto" in the href attribute.I am using php. I want to match links like:
<a href='http://www.mysite.com/goto/profile'>links </a>
I have written a regex like:
<a.*(href).*(goto).*<\/a>
It is working for all links like above. But if there is a new line in the anchor tag then it does not match. E.g:
<a href='http://www.mysite.com/goto/profile'>
links </a>
It does not match because of the new line. I need a regular expression to match links with and without new lines.