Hello Richard,

Thursday, January 27, 2005, 6:23:53 AM, you wrote:

GR> I'm trying to get my head around regular expression matching. 
 
GR> body     MANGLED_CASH
GR> /(?!cash)\b[cǩ\(][_\W]{0,[EMAIL PROTECTED],5}[sz5\$][_\W]{0,5}h\b/i

GR> My understanding of rule matching was that the '(?!cash' bit
GR> required an | (or) in order to work. Can anyone break down the
GR> logic of how SA tests this line?

GR> /(?!cash)
Do NOT match "cash"
GR> \b
What ever does match needs to begin at the beginning of a word. There
must be a beginning of line or non-word character to the left, and a
word character to the right.
GR> [cǩ\(]
First character matched must be a C or some variation thereof
GR> [_\W]{0,5}
Next character(s) matched must be some non-alphanumeric character.
There may or may not be any, and no more than 5.
GR> [EMAIL PROTECTED]
Next letter is an A
GR> [_\W]{0,5}
GR> [sz5\$]
Next letter is an S
GR> [_\W]{0,5}
GR> h
Next letter is an H
GR> \b
That H has to be followed by a non-word character or end of line
GR> /i
Ignore case -- treat CA$H the same as ca$h.

Bob Menschel



Reply via email to