Test (): determines whether a string matches the specified mode.
Exec (): returns an array. The first entry in the array is the first match, and the others are reverse references.
Match (): returns an array containing all matching strings.
Search (): returns the first matched position in the string.
Replace (): replace all matches in a string with another string.
Split (): splits the string into a series of substrings and returns them using an array.
Global: Indicates whether G is set
Ignorecase: Indicates whether I is set
Multiline: Indicates whether M is set
Lastindex: indicates the position of the next matching character.
Source: The Source string form of the Regular Expression
Input: string used for testing
Lastmatch: The last matched character
Lastparen: The last matched group.
Leftcontext: The substring before the last match
Rightcontext: The substring after the last match
Multiline: Specifies whether all expressions use multiline mode.
Greedy, inert, and supporting quantifiers
Greedy quantifiers first check whether the entire string matches. If no match is found, remove the last character in the last string and try again. If no match is found, remove the last character again, this process repeats until it finds that no strings are matched or left. The simple quantifiers above are greedy quantifiers.
The inertia quantizer first checks whether the first letter in the string is a match. If it does not match, it will continue to read the next character for matching. If it does not, it will continue to match, just opposite to the greedy quantizer, what is the same as the simple quantizer used by the inertia quantizer? .
The dominant quantizer only attempts to match the entire string. If the entire string does not match, no further attempt is allowed.
Note: IE and opera do not support quantifiers.
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.