How to use a case-insensitive modifier in a textbox regular expression?

  • 27 February 2018
  • 3 replies
  • 12 views

Badge +3

I'd like to use the case-insensitive modifier (/i) in the regular expression, under Validation, for a single line textbox in a form.

For example, if I were attempting to validate a URL that begins with http://...  I want to allow these variations:

http://

hTtP://

HTtp://

and so on.  I realize that I can accomplish this with brackets, as in [Hh][Tt][Tt][Pp]://, but it gets more cumbersome as the pattern match gets longer.

Adding the modifier to the end of the regex, like I would in Javascript, breaks it.  The only hits I have found while searching are about setting the Ignore Case switch in a regex action.


3 replies

Userlevel 5
Badge +14

unfortunatelly that's not possible.

you'd need to write custom validation function and perform case insensitive regex check within custom javascript code.

Badge +3

Thank you, Marian.  I had a feeling this was the case.

Userlevel 5
Badge +14

ahh, I've recalled possibility of use of inline modifiers.

try following

(?i)http://

Reply