Hi guys,
Thanks for the reply, but it doesn't seem to answer my question. I'll include a code sample this time, so maybe I can be more clear.
This is from the popular phpBook Guest book script that is available. I am actually doing my own guest book, but I came across this one, and found the regex validation and was looking at it.
Here's where I am cofused:
$msg = eregi_replace("\[url\]www.([\[]*)\[/url\]", "replace ment stuff");
looking at the left side (I didn't copy the replacement regex), I see that there is "\[", but my question is why shouldn't this be "[". It is for replacing the popular VBB propreitary URL tags.
I have a Windows-based POSIX/PHP regex testing program, and that code doesn't match, however, the following does, and it makes more sense to me:
[url]www.([[]*)[/url]
Notice, all I did was remove the double slashes and replace them with a single slash. So back to my original question, how come there are double slashes to escape the '[' and ']' brackets? Doesn't make sense to me. I've seen this in other people's code too in the past. The only viable solution that makes sense relates to the "magic_quotes" setting.
Thanks