Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regex case insensitive

How do I put this regex in case insensitive?

var message_id = result.match(/Message-Id\:(.*)/)[1].replace(/^\s+/, '');

Thanks

like image 346
donald Avatar asked May 16 '11 16:05

donald


People also ask

Are regex expressions case-sensitive?

By default, the comparison of an input string with any literal characters in a regular expression pattern is case-sensitive, white space in a regular expression pattern is interpreted as literal white-space characters, and capturing groups in a regular expression are named implicitly as well as explicitly.

Does case matter in regex?

Discussion. Currently, REGEXP is not case sensitive, either.

Is regex case-sensitive in python?

re. IGNORECASE : This flag allows for case-insensitive matching of the Regular Expression with the given string i.e. expressions like [A-Z] will match lowercase letters, too. Generally, It's passed as an optional argument to re.


1 Answers

With the i flag:

/Message-Id\:(.*)/i
//                ^

Documentation →

like image 151
Felix Kling Avatar answered Sep 30 '22 11:09

Felix Kling