Forum Moderators: coopster
Trying to create a regular expression that grabs everything inside of
[quote]
text
[/quote]
I can do it with preg_replace("/\[quote\](.*?)\[\/quote\]/", $var,$var);
but it doesn't do it with new lines, any help would be much appreciated been trying to figure this out for hours now.
Thank You,
Wesley
$pattern = "/\[quote\](.*?)\[\/quote\]/s";
Notice the use of the 's' pattern modifier: [php.net...]
I just ran into another small change, wouldn't I add like an! if I wanted it to do it to have it only do it when something does not appear.
Like:
original - /\[quote\](.*?)\[\/quote\]/s
modified - /\[quote\](!\[quote\])(.*?)\[\/quote\]/s
only do it when there is NO [quote] inside the two open and close quote brackets?
Thanks again appreciate your help