Page 2 of 2
Posted: Tue Sep 28, 2004 4:10 pm
by feyd
nonononon.. I used the matches found in the preg_match call to do the str replace.. not str_replacing the beginning and ending junk..
Posted: Tue Sep 28, 2004 4:14 pm
by tony montana
I have no idea how todo that

Posted: Tue Sep 28, 2004 4:21 pm
by feyd
a preg_match* returns the string it matched, plus any groupings you requested.. Since the preg_match_all I wrote returns the offsets, you can use those to extract the entire string (from beginning to its actual end) to replace. Once you have this entire string, you can use a preg_replace on it to change out the beginning and ending marks (using the greedy syntax)
Posted: Tue Sep 28, 2004 4:39 pm
by tony montana
lol I got lost, besides thats pretty extreme for something like quote tags.
Any other ideas?
Posted: Tue Sep 28, 2004 4:54 pm
by feyd
I haven't ever had any problems with using preg_replace with the quote tags before..
Posted: Tue Sep 28, 2004 5:09 pm
by tony montana
Big diffrence between preg replace and what your proposing ;p
Posted: Tue Sep 28, 2004 5:11 pm
by feyd
there's actually not all that much different.. the way I first suggested handles things that can be sensitive to nesting.