RegEx: How to check for Case in pattern?
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 63
- Joined: Thu Dec 10, 2009 8:13 am
RegEx: How to check for Case in pattern?
How to check proper case in a pattern using RegEx?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
This modifier turns off case insensitive (makes the matching case sensitive):
(?-i)
(?-i)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 63
- Joined: Thu Dec 10, 2009 8:13 am
example
Could you please provide one example?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Consider the following:
This will match and return only M1234 and M5555
If you change it to:
Then it will return all matches M1234, m234, M5555 and m43
Code: Select all
Let>pattern=(?-i)M\d*
Let>text=M1234m234M5555m43
RegEx>pattern,text,0,matches,nm,0
If you change it to:
Code: Select all
Let>pattern=M\d*
Let>text=M1234m234M5555m43
RegEx>pattern,text,0,matches,nm,0
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?