Anyone here good with regex?

fly

omg
Oct 1, 2004
79,102
27,214
1,323
Marklar
₥84,110
Steam
mattressfish
Jesus, why does this stuff have to be so complex?

I need to search for a HTML URL (<a href="blah.com">Blah</a>), then replace it with just Blah.

Can anyone even help search for an HTML anchor? I have two regex strings that I've found on the internets so far, both seem to work for some URLs. They are:
Code:
<a[ ]{0,}href=[\"']{0,}([a-zA-Z0-9/:~._#]{0,})[\"']{0,}>([^<]{0,})</a>

<a[^>]*>.*?</a>

Anyone?
 
Okay, now my problem is getting regex to work inside of PHP's str_replace function. It seems that it won't. :(

edit: Looks like I need preg_replace, but that doesn't work either. Argh. PHP experts here?
 
Last edited: