JavaScript RegExp Reference | javascript regexp
TheRegExpObjectAregularexpressionisapatternofcharacters.Thepatternisusedforsearchingandreplacingcharactersinstrings.TheRegExpObjectisaregularexpressionwithaddedPropertiesandMethods.SyntaxExampleexplained:w3schoolsThepatterntosearchfor/w3schools/Aregularexpression/w3schools/iAcase-insensitiveregularexpressionForatutorialaboutRegularExpressions,readourJavaScriptRegExpTutorial[1].BrowserSupport/regexp/isanECMAScript1(ES1)feature.ES1(JavaScript1997)isfullysupportedinallbrowsers:ChromeEdgeFirefox...
The RegExp ObjectA regular expression is a pattern of characters.
The pattern is used for searching and replacing characters in strings.
The RegExp Object is a regular expression with added Properties and Methods.
SyntaxExample explained:
w3schoolsThe pattern to search for/w3schools/A regular expression/w3schools/iA case-insensitive regular expressionFor a tutorial about Regular Expressions, read our JavaScript RegExp Tutorial[1].
Browser Support/regexp/ is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome Edge Firefox Safari Opera IE Yes Yes Yes Yes Yes Yes ModifiersModifiers define how to perform the seach:
Modifier Description /g[2] Perform a global match (find all) /i[3] Perform case-insensitive matching /m[4] Perform multiline matching BracketsBr...