1. metacharacters in regular Expressions:
| The code is as follows |
|
([{\^ $ |)? * +. Example 1: Alert (/\?/.test ("?")); Example 2: Alert (/\\?/.test ("?")); |
Double escape, avoid translation by translation n mode?
2. Special characters
1. Use ASCII to represent a character
Specifies a two-bit hexadecimal code preceded by x, such as: X62 is a B-B character with an ASCII code of 98, equal to 16 62
Example 1:
| The code is as follows |
|
var scolor= "Blue"; var reb=/\x62/; Alert (Reb.test (Scolor)); |
1428 in to B
Example 2:
| The code is as follows |
|
var scolor= "Blue"; var reb=/\142/; Alert (Reb.test (Scolor)); |
2.Unicode with u plus four hexadecimal notation B is 0062
Example 3:
| The code is as follows |
|
var scolor= "Blue"; var reb=/\u0062/; Aert (Reb.test (Scolor)); |
3. Other special characters
R
| special character |
|
| |
description |
| T |
tab |
| n |
return |
| page feed |
| a |
alert character |
| e |
escape character |
| ">" "> CX |
corresponding control characters for x |
| b |
fallback character |
| v |
vertical tab |
| |
null character |