Do a multiline search for "is" at the beginning of each line in a string:
The marked text below shows where the expression gets a match:
The m modifier is used to perform a multiline match.
The m modifier treat beginning (^) and end ($) characters to match the beginning or end of each line of a string (delimited by \n or \r), rather than just the beginning or end of the string.
Note: The m modifier is case-sensitive and will stop the search after the first match. To perform a global, case-insensitive, multiline search, use this modifier together with "g" and "i".
Tip: Use the multiline property to specify whether or not the m modifier is set.
The m modifier is supported in all major browsers.
JavaScript Version: | 1.5 |
---|
Do a global, multiline search for "is" at the beginning of each line in a string:
The marked text below shows where the expression gets a match:
Do a global, case-insensitive, multiline search for "is" at the beginning of each line in a string:
The marked text below shows where the expression gets a match:
Do a global, multiline search for "is" at the end of each line in a string:
The marked text below shows where the expression gets a match: