A quick Google gives:
Options
Another approach to handling case insensitivity is to use the IgnoreCase
regex option. Options alter the overall regex matching behavior and, you
guessed it, IgnoreCase turns off regex's default case sensitivity. The
IgnoreCase option can be specified by prepending the short-form of the
option 'i' in a special construct at the beginning of the regex, like so:
(?i)coolThis inline syntax applies the option to an entire regex. However,
an alternative syntax allows you to apply an option to either the whole
expression or a subexpression:
(?i:c)ool
(see
http://www.ddj.com/dept/windows/184416603)Or you could try:Using the
Regex ClassAlmost anything you do with regular expressions in .NET starts
out by defining a Regex instance for the regular expression of interest,
like this (where pattern is your regular expression)
im re As New
RegEx(pattern)
Another Regex constructor lets you set options
im re As New RegEx(pattern,
options)
The available options are represented in the RegexOptions enumeration. The
options you are most likely to use are explained in Table 2. For the others
you can refer to the Visual Studio documentation. To set a single option,
pass it to the Regex constructor
im re As New RegEx(pattern,
RegexOptions.IgnoreCase)
To set two or more options, combine them with Or
im re As New
Regex(pattern, RegexOptions.IgnoreCase Or RegexOptions.RightToLeft)
Table 2. RegexOption members.Member Description IgnoreCase Specifies
case-insensitive matching. The default is case-sensititve ("a" does not
match "A", etc.). Multiline Multiline mode. The metacharacters ^ and $
will match the beginning and end, respectively, of any line and not just the
beginning and end of the entire input string (the default). RightToLeft
Specifies that the search will be performed right-to-left rather than the
default left-to-right. SingleLine Single line mode. Changes the meaning of
the period (.) metacharacter so that it matches any character including the
newline \n. By default it matches any character except the newline.
from:
http://www.devsource.com/article2/0,1895,2087373,00.aspPeter"shapper"
"\w+([-+.]\w+)*@MyDomain\.com" ?
But I don't want MyDomain.com to be case sensitive.
Any variation would be accepted. for example:
MyDomain.Com
mydomain.com
MYDOMAIN.COM
Does not really matter
Thanks,
Miguel