Reg Expression
| From: | Scott Mebberson | Date: | Fri, 15 Dec 2000 00:13:34 +0000 |
| Subject: | Reg Expression | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-30410@lists.php.net to get a copy of this message | ||
Hi guys I have some html text and I am trying to find all instances of '<a
href="*">' and replace it with [link | *] - I also have to be able to get it
back the other way so if someone writes [link | *] I can put it back into
'<a href="*">'. * will could contain a-z, A-Z, 0-9 and/or #.
The following is the reg ex I am currently trying to use, but it is not
working. - Also, I am not sure how to make it remember the value of * so I
plug it into the new format. Does anybody have any ideas??
$content = ereg_replace("<\/a href=\"(.+)\">", "[link]",
$content); // this
is for </a>
thanks
Scott.