Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-14-2006, 11:44 PM   PM User | #1
tylerjca
Regular Coder

 
tylerjca's Avatar
 
Join Date: Dec 2002
Location: Canada
Posts: 161
Thanks: 1
Thanked 0 Times in 0 Posts
tylerjca is an unknown quantity at this point
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...

Code:
<?php
$regex = '/^(?!\[code\](.*?)\[color=(.*?)\](.*?)\[\/color\]^(?!(.*?)\[\/code\]))/';
$text = preg_replace($rregex,"<span style='color:$2'>$3</span>",$text);
?>
Thanks in advance
tylerjca is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:46 AM.


Advertisement
Log in to turn off these ads.