regular expressions gods!
| From: | Justin French | Date: | Wed, 23 Aug 2000 02:54:06 +0000 |
| Subject: | regular expressions gods! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-13065@lists.php.net to get a copy of this message | ||
Okay,
I have a series of strings, $TAGS[1], $TAGS[2]
thru to TAGS[????].
I want to search these strings for any link to a
.php3 file within the current directory, with any
query string (or none). So it might be page.php3,
or page.php3?id=stuff, or whatever.
in DOS syntax, <A HREF="*.php3*"
I then want to preceed the file name (eg page.php3)
with a $prefix string. In otherwords, if the prefix
is "text_", <A HREF="page.php3" will get turned into
<A HREF="text_page.php3"... if there is a query string,
or any other stuff in the <A> tag (like a TARGET=) it
should all stay intact.
Thanks heaps for any help / solutions posted :)
Justin French