Hi
I'm using PHP's preg_replace function that can handle regular expressions.
I'm trying to remove a <a href="xxx.com">click here<a> from a bunch of HTML, but the link itself contains a random number, and there is some text directly after the </a> that I'm also trying to remove.
So, for example:
sample text:
asdsa sad asd sada hkjas <a href="xxx.com?a=3243243243
2>click here</a> to follow link. asdsadsad asda das dsad asd <a href="xxx.com">click some more</a> sdasadasd ad adsa sad adasd dsad ada das
I want to match and remove ( replace with "" ) >> <a href="xxx.com?a=3243243243
2>click here</a> to follow link.
where the "32432432432" is random, while leaving other <a> tags untouched - hence the attempt to match as much as possible with only the number as a "wildcard"...
Start Free Trial