No, it didn't work. I've tried [:space:]$bannedwords[$i][:space:],
\<$bannedwords[$i]\>, and \b$bannedwords[$i]\b. It doesn't detect anything.
I'm reading a list of banned words out of a text file and putting them into
$bannedwords. I'm pretty sure $bannedwords is right, since I've tried stuff
like "test" (detected), "\<test\>" (not detected), "[:space:]test[:space:]"
(not detected).
And, in all times, I use the syntax like this: $string =
eregi_replace("a","[censored]",$string);
So I'm sure the syntax is right.
Thanks for your help, though.
--Neal
-------------------
did it work?
----- Original Message -----
From: Team JUMP <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 20, 2001 12:35 PM
Subject: Re: [PHP] Help w/ regular expressions for banned words
Thanks for your help. Unfortunately, [:space:]$bannedwords[$i][:space:]
would not work, since I need to also check for the first and last word. In
a last-case scenario I could write special code for the first and last word,
but that may get ugly with bug-checking... but I've already tried
"\s+$bannedwords[$i]\s+" to no avail. I believe [:space:] is just a
substitute for \s+, right?
Yeah, I've tried \<$bannedwords[$i]\> too, unfortunately. Like I said
before, eregi_replace("a","[censored]",$string) makes a match, but
eregi_replace("\<a\>","[censored]",$string) or
eregi_replace("\ba\b","[censored]",$string) does not. Most odd.
Thanks for your help, though. Anyone else have suggestions?
--Neal
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]