The RegExp object in JS
>
JavaScript provides a RegExp object to complete the operation and functionality of regular expressions, and each regular expression pattern corresponds to a regexp instance. There are two ways to
There are two ways to create an instance of a RegExp object.
Using the explicit constructor of REGEXP, the syntax is: New REGEXP ("pattern" [, "Flags"]).
Use the implicit constructor of RegExp, in plain text format:/pattern/[flags].
The pattern
You can create an instance of the RegExp object in two ways.Use RegExp's explicit constructor. Syntax: new RegExp ("pattern" [, "flags"]).Use RegExp's implicit constructor in plain text format:/pattern/[flags].The pattern part is required for the
QuestionI. What does (RegExp. $ _) and (RegExp ["$ &"]) mean?2. What do we often see in RegExp. $1?If you have read the above two questions, you don't know what it means. It doesn't matter. This article mainly describes the attributes of these
have been more afraid to use regular expressions, seemingly very abstruse and complex appearance, so in the use of JS to manipulate strings, I use the most is replace, split, substring, indexof, and other functions, these functions sometimes need to
JavaScript provides a RegExp object to complete the operation and functionality of regular expressions, and each regular expression pattern corresponds to a regexp instance. There are two ways to create an instance of a RegExp object.
Using the
Using the explicit constructor of REGEXP, the syntax is: New REGEXP ("pattern" [, "Flags"]).
Use the implicit constructor of RegExp, in plain text format:/pattern/[flags].
The pattern section is required for the regular expression schema text to be
Using the explicit constructor of REGEXP, the syntax is: New REGEXP ("pattern" [, "Flags"]).
Use the implicit constructor of RegExp, in plain text format:/pattern/[flags].
The pattern section is required for the regular expression schema text to be
Use RegExp's explicit constructor. Syntax: new RegExp ("pattern" [, "flags"]).Use RegExp's implicit constructor in plain text format:/pattern/[flags].The pattern part is required for the regular expression pattern text to be used. In the first
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.