Spam Filter ISP Support Forum

  New Posts New Posts RSS Feed - Regex case sensitivity broken
  FAQ FAQ  Forum Search   Register Register  Login Login

Regex case sensitivity broken

 Post Reply Post Reply
Author
Alec Skelly View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alec Skelly Quote  Post ReplyReply Direct Link To This Post Topic: Regex case sensitivity broken
    Posted: 06 April 2004 at 10:10pm

On version 1.2.0.212 the following regex will not match the text "Subject":

(Subject)

But this will match:

((?i)Subject)

If there is a capital letter in the regex, (?i) must be used to detect even an exact match in the text.  If the regex is in all lowercase, it will match regardless of the case of the text even without (?i).  If case sensitivity is explicitly turned on with (?-i) and the regex is in uppercase, it will not detect even an exact match in the text:

((?-i)SUBJECT)

does not match "SUBJECT" in the text.

I hope I'm making sense...

Thanks

 

Back to Top
Ronny T View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ronny T Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2004 at 4:30am
(?i) Turn on case insensitivity for the remainder of the regular expression. (Older regex flavors may turn it on for the entire regex.)

 

Hi

I think you got it backwards, (?i) makes in case INsensitiv...

But I see your point I tested:

Subject will not find Subject

subject will find Subject

((?i)subject) will fine Subject also... etc

Back to Top
Alec Skelly View Drop Down
Guest Group
Guest Group
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alec Skelly Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2004 at 6:36pm

You can prefix any of the modifiers with a - to do the opposite, so (?i) makes it case insensitive and (?-i) makes it case sensitive.

 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.156 seconds.