View Single Post
Old 04-06-2008, 05:47 PM   #8 (permalink)
Geert
The Contributor
RegEx Guru 
 
Join Date: Dec 2007
Location: Belgium
Posts: 60
Thanks: 6
Geert is on a distinguished road
Default

Quote:
Originally Posted by mortisimus View Post
Code:
[ b]bold[/b] not bold [ b]bold again[/b]
I would have to say that the best way to tackle this is create a seperate match for [ b] and [/b]
I'll teach you a new regex trick. Lazy (opposite of greedy) matching. Matches as less as possible.

#\[b\](.*?)\[/b\]#i
__________________
Kohana - PHP5 framework
Geert is offline  
Reply With Quote
The Following 3 Users Say Thank You to Geert For This Useful Post:
delayedinsanity (04-07-2008), mortisimus (04-08-2008), Orc (04-07-2008)