Aryan PrajapatKnowledge Contributor
What are modifiers in regular expression
What are modifiers in regular expression
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
Modifiers in regular expressions are special symbols or flags that alter the behavior of the pattern matching. Common modifiers include:
* i: Case-insensitive matching.
* g: Global matching (find all matches rather than stopping after the first).
* m: Multiline mode (treats ^ and $ as matching the start and end of each line, not just the start and end of the string).
* s: Dotall mode (allows the dot . to match newline characters).
* x: Extended mode (ignores whitespace and allows for comments in the regex pattern).