Sam Masiello <mailto:[EMAIL PROTECTED]>
    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 *think* you need to do \\\[ and \\\].

[ is a special character in regex so it must be escaped (oh btw, it's
called escaping and not backlashing...) like so: \[. but that's only if
you want to grab a single [ by itself. if you're looking for a \ you'll
also need to escape this since it too is a special character. so you'd
do \\. but in your case you just happen to have everything next to each
other and i think that may be what's confusing you.

\\ will match \
\[ will match [

\\\[ will match \[

(keep in mind that \\ and \[ don't need to be next to each other to
match \[ if they are contained within one of those regex OR lists...
[...])


i used the regex coach (something i highly recommend you get) to
"figure" this out (assuming i'm right at all).


hope this helps!
chris.

p.s. the following regex:

[\w\s\\\[\]\.]*

will match:

Here is some text \[for\] j00.

keep in mind this may or may not be what you want...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to