
JavaScript – RegExp g Modifier
In JavaScript RegExp, the “g” modifier specifies a global match, which finds ALL matches, and NOT just the first match.
In JavaScript RegExp, the “g” modifier specifies a global match, which finds ALL matches, and NOT just the first match.
In JavaScript RegExp, the “i” modifier specifies a case-insensitive match.
In JavaScript RegExp, the “m” modifier specifies a multiline match. ^ specifies a match at the start of a string. $ specifies a match at the end of a string.
The JavaScript RegExp Group [0-9] searches for a specific number in a string.
The JavaScript RegExp Group [^0-9] searches for a specific number NOT in a string.
The JavaScript RegExp Group [abc] searches for a specific character in a string.
The JavaScript RegExp Group [^abc] searches for a specific character NOT in a string.
The JavaScript RegExp Group (x|y) expression is used to find ANY of the alternatives specified.
The JavaScript RegExp . metacharacter is matches ANY character, except newline or other line terminators.
The JavaScript RegExp \0 metacharacter matches NUL characters.
The JavaScript RegExp \b metacharacter matches at the beginning or end of a word. Search for ma at the beginning of a word (\bma), at the end (ma\b).
The JavaScript RegExp \B metacharacter matches NOT at the beginning or end of a word. Search for ma NOT at the beginning (\bma), or the end (ma\b).
The JavaScript RegExp \d metacharacter matches digits from 0 to 9.
The JavaScript RegExp \D metacharacter matches non-digit characters.
The JavaScript RegExp \f metacharacter matches form-feed characters (\f).
The JavaScript RegExp \n character matches newline characters (\n).
The JavaScript RegExp \s metacharacter matches whitespace characters.
The JavaScript RegExp \s metacharacter matches non-whitespace characters.
The JavaScript RegExp \r metacharacter matches carriage return characters.
The JavaScript RegExp \t metacharacter matches horizontal tabs.
Thanks for your support!
All are affiliate links. Thank you for your support!