tags:

views:

25

answers:

2

I used the regular expression (/\<+\/+\s+/gm,"</"). If i remove the g the regular expression don't work. Please let me know technical difference between 'g-global and m-multiple'.

+1  A: 

From http://www.regular-expressions.info/javascript.html

  • /g enables "global" matching. When using the replace() method, specify this modifier to replace all matches, rather than only the first one.

  • /i makes the regex match case insensitive.

  • /m enables "multi-line mode". In this mode, the caret and dollar match before and after newlines in the subject string.

Luca Matteis
what is the dollar match?
A: 

See also http://php.net/manual/en/reference.pcre.pattern.modifiers.php

ivan73
Also quote the relevant parts of that page. Link-only answers are under-appreciated because: (1) The reader has to muck through another site, (2) Such linked pages often change or disappear.
Brock Adams
(1) Ok, you are right. (2) in this case I doubt this page would change or disappear.
ivan73