Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
06-14-2006, 11:44 PM #1
regex for no parsing between [code][/code]
I've been trying to figure this out all day..
I hope someone can help me out
I need a way to make it so certain tags (eg. [color=???][/color]) will only parse when they are outside of tags.
I've been playing around with it and everytime I get close, it messes up.
Here's what I have so far...
<?php $regex = '/^(?!\[code\](.*?)\[color=(.*?)\](.*?)\[\/color\]^(?!(.*?)\[\/code\]))/'; $text = preg_replace($rregex,"<span style='color:$2'>$3</span>",$text); ?>