Regular Expressions:
Search (a);//Query the location of a
SUBSTRING (2,5)//Get to 2 to 4 bits
Chartat (3);//Get to 3rd place
Split ('-');//-Slice
(1)
RegExp Object
JS notation:-----New RegExp ("A", "I");//i ignores case, finds a
Perl notation:-----/a/i
Search
/a/i
(2)
Match gets a matching item
/\d/: Escape//Find first number
/\d/g://found all the numbers and was sliced.
/\d+/g//Find all the numbers that are not sliced
(3)
Replace
re =/a/g;
Str.replace (Re, ' 0 ');
(4)
[Abc]a=aa, BA, CA
Cases
[A-z]:a to Z
[0-9]:0 to 9
[^a-z]: exclude A to Z
(5)
Escape character
. (dot)-----Any character
(6)
The characteristic greed of the regular--match as much as possible
(7)
Commonly used escape characters
\d Digital
\w English, numerals, underline
\s whitespace characters
\D[^0-9]
\w non-English, numerals, underline
\s non-English, numerals, underline
(8)
Quantifier: Number
{n}//occurs exactly n times
{n,m}//at least n times, up to M times
{n,}//at least n times, Maximum unlimited
Cases
\D{8}//8 a number
(0).//0 dispensable
Commonly used quantifiers
{n,}//at least n times, Maximum unlimited
*//any time
?//0 or one time
+//once or any time
(9)
.------>\.
(10)
Re =//i
Re.test (char)//Verify that char is not in accordance with the re//feature meets the requirements, true
^ Beginning of the line
$ End of line
JavaScript essay 8