Regular Expressions:
Regular Expressions (Regular expression), also known as formal notation , conventional notation .
A regular expression uses a single string to describe and match a series of strings that conform to a certain syntactic rule.
Method:
1. Reg.test (strobject)
returns a Boolean value . Used to test for the presence of a regular expression pattern in a string parameter, and returns True if present, otherwise false
2. Reg.exec (Strobject)
returns an array or null.
method is used for the regular expression pattern to run a lookup in a string, and if Exec () finds the matched text, it returns an array of results. Otherwise, NULL is returned.
In addition to the above two methods, some string functions can be passed into the RegExp object as parameters for some complex operations
You can refer to this article for comparisons like manuals, except that the escape symbol "\" is written incorrectly as "/". Manual
Also refer to the article. Illustrated two illustrations
JavaScript Regular Expressions