If I am matching a word in a regex 'Strict-Transport'
how can I make it case insensitive? Is there any way other than putting the two character cases [Ss] for each character because it is not about the initials, but all the characters can come in any case?
I looked at previous posts but there are not like my case. This post for example shows how to make regex case insensitive when using list of characters []
. But my case is a word in regex.
Case-Sensitive Match To disable case-sensitive matching for regexp , use the 'ignorecase' option.
A repeat is an expression that is repeated an arbitrary number of times. An expression followed by '*' can be repeated any number of times, including zero. An expression followed by '+' can be repeated any number of times, but at least once.
You can use i
modifier to make regex case-insensitive, e.g.:
(?i)ab
will match ab
, Ab
, aB
and AB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With