RE: [PHP] Backslashing the [ and ] in a regex

2004-02-04 Thread Adam Bregenzer
On Wed, 2004-02-04 at 16:35, Sam Masiello wrote: > Thank you for the reply, Adam, but unfortunately it didn't work. Sorry bout that. Here's another shot at it. If I understand your goal correctly you want to escape the existing backslashes that proceed certain special characters (namely [:alpha:

RE: [PHP] Backslashing the [ and ] in a regex

2004-02-04 Thread Chris W. Parker
Sam Masiello on Wednesday, February 04, 2004 1:36 PM said: > Thank you for the reply, Adam, but unfortunately it didn't work. So you want to accept input that may or may not look like the following? Here is some \[text\] for j00. Well I'm no regex expert but I *th

RE: [PHP] Backslashing the [ and ] in a regex

2004-02-04 Thread Sam Masiello
Thank you for the reply, Adam, but unfortunately it didn't work. --Sam Adam Bregenzer wrote: > On Wed, 2004-02-04 at 14:06, Sam Masiello wrote: >> $rule = ereg_replace("[[:alpha:]+*/.|<>()$]", "0", $rule) ; >> >> But if the user backslashes either a left or right bracket ([ or ]), >> I

Re: [PHP] Backslashing the [ and ] in a regex

2004-02-04 Thread Adam Bregenzer
On Wed, 2004-02-04 at 14:06, Sam Masiello wrote: > $rule = ereg_replace("[[:alpha:]+*/.|<>()$]", "0", $rule) ; > > But if the user backslashes either a left or right bracket ([ or ]), I > am having difficulty getting that extra backslash into the string. I > tried just adding the [ and ]