Re: [PHP] Perl regular expression bug

2001-01-17 Thread Monte Ohrt
It's a bug. Try the latest CVS, it has been fixed. Shaun Thomas wrote: > > This only applies to PHP 4.0.4 > > Back with PHP 4.0.2, I could do this: > > $string = "[["; > $string = preg_replace("/(\W)/", "1", $string); > ?> > > $string would then contain "\[\[". > > Now, if I use that sa

Re: [Fwd: [PHP] Perl regular expression bug]

2001-01-16 Thread Andrei Zmievski
> This only applies to PHP 4.0.4 > > Back with PHP 4.0.2, I could do this: > > $string = "[["; > $string = preg_replace("/(\W)/", "1", $string); > ?> > > $string would then contain "\[\[". > > Now, if I use that same code, $string contains "\\1\\1\\1\\1". > > I tried to compensate for th

Re: [PHP] Perl regular expression bug

2001-01-15 Thread Richard Lynch
> $string = "[["; Okay. I don't think [ is special in PHP. { is a new special character, though. > $string = preg_replace("/(\W)/", "1", $string); \W -- what's that? You probably need \\W there... > ?> > > $string would then contain "\[\[". I dunno about that. This Regex stuff is ov

[PHP] Perl regular expression bug

2001-01-15 Thread Shaun Thomas
This only applies to PHP 4.0.4 Back with PHP 4.0.2, I could do this: $string would then contain "\[\[". Now, if I use that same code, $string contains "\\1\\1\\1\\1". I tried to compensate for this using PHP's new ability to allow perl syntax in the replace section. That leaves $string w