In javascript regular expressions, you can put in a ‘g’ modifier for global, and ‘m’ for multiple. What’s the difference between them, or are they the same thing?
Share
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.
mdoes not stand for “multiple”, but for “multiline”. And it makes^and$match at line beginnings and line endings, respectively (instead of just the beginning and ending of the string).Well, and
greally means “global”, so that the regex engine continues to find further matches after the first one.Further reading about regex modifiers.