The optional combination of the above regular expression can match a character, or a dot, but cannot match the null character;
Tell me the difference: 1. . in [] the inside, it is to match . , in the outside when it is used to match any character, see the following example:
/./.test(" "); //true/[.]/.test(" "); //false
2. * and + on the [] outside is called the quantifier (quantifier of the quantity word), is to indicate the quantity to match, *Represents any number, which is represented by a set [0, +00) ; +Represents at least 1 times, the set represents Yes [1, +00) ; It has to be said that, as a quantifier, * and the + preceding must follow the meaning of the regular expression (part); Within it means the [] meaning of itself, in order to match * or + ;
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.