I want to validate an email address with Regex in C#.
I'm using this pattern:
^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$
This pattern only matches upper case letters. For example:
"[email protected]" --> returns false. "[email protected]" --> returns true.
I obviously would like that the first example will also return true.
NOTE: I DON'T want to use the RegexOptions.IgnoreCase flag.
I would like to change the pattern itself to match the first example. I think that I can add a "/i" in the end of the pattern or something like this but it doesn't seems to work. I prefer not to use the "?i" in the beginning as well.
How can i achieve this?
(If you could rewrite the whole pattern for me, it would be great!).
Thanks.
imodifier any better than .NET'sRegexOptions.IgnoreCase? Is it because it's 22 characters less to type?travelormuseum