Re: [PHP] preg_replace and regular expressions.

2007-04-16 Thread Richard Lynch
http://php.net/preg_replace_all And be sure to use Ungreedy flag to your pattern: /pattern/U On Sat, April 14, 2007 11:22 pm, Travis Moore wrote: > Okay, so what I have is a BB code type of thing for a CMS, which I for > obvious reasons can't allow HTML. > > Here's the snippet of my function: > >

RE: [PHP] preg_replace and regular expressions.

2007-04-15 Thread Buesching, Logan J
In your regex, you have a greedy matcher, i.e. ".*" will match as much as it can to satisfy its condition. I believe you can do ".*?" and it will work, as ".*?" will match as little as it can to be satisfied. -Logan -Original Message- From: Travis Moore [mailto:[EMAIL PROTECTED] Sent: S