0

So I need to make regex validation case insensitive. I know in the Javascript regex engine you can pass in something like this /regex/i to the constructor of RegExp.

The problem is that with ASP RegularExpressionValidator there is nothing to tell it that the regex is case insensitive and the javascript that does the work on the client side does not give any options to pass this flag.

How have you guys gotten around this issue short of creating a regex like [A-Za-z]. As you can imagine this gets very complex and ugly when the regex is complex.

Taf Munyurwa
  • 1,444
  • 2
  • 16
  • 22
  • 1
    Possible duplicate of: https://stackoverflow.com/questions/2641236/make-regular-expression-case-insensitive-in-asp-net-regularexpressionvalidator – Rahul Sharma Apr 02 '19 at 14:56
  • Thanks that actually confirms my suspicion that I will have to use case classes [A-Za-z] – Taf Munyurwa Apr 02 '19 at 15:01
  • If any one comes across this in the future. You can get around this problem by using a custom validator and pointing it to clientside and a serverside validation functions. You can then use a RegExp in javascript and pass the required flags. – Taf Munyurwa Apr 04 '19 at 08:38

0 Answers0