JavaScript RegExp Objects
One. RegExp Object
A regular expression is an object that describes a character pattern.
Regular expressions are used to match string patterns and retrieve replacements, and are powerful tools for performing pattern matching on strings.
1. Syntax
1 var patt=New RegExp (pattern,modifiers); // Mode 1 var patt=/pattern/modifiers; // Mode 2
*pattern (Mode) describes the pattern of an expression
*modifiers (modifier) for specifying global matches, case-sensitive matching, and multi-line matching
2. Modifiers
Modifiers are used to perform case-sensitive and global matching
3. Meta-Characters
Metacharacters is a character with a special meaning.
4. quantifiers
5. Square brackets
Square brackets are used to find characters in a range
Two. RegExp Object methods
1. Basic methods
2. String method that supports regular expressions
1.javascript-Regular Expression Basics