Regular Expression. No. metacharacters (except for carriage return \ r and line feed \ n), regular expression line feed
Regular Expression. No. metacharacters:
The dot (.) metacharacters can match any character except the carriage return (\ r) and line feed (\ n.
Syntax structure:
Constructor method:
New RegExp (".")
Method of direct object volume:
[JavaScript] view the copy Code Execution Code in plain text
/./
Browser support:
Internet Explorer supports this metacharacter.
Firefox supports this metacharacter.
Google Chrome supports this metacharacter.
Note:
In ie 9 or later or other standard browsers, the decimal point can match any character other than the carriage return (\ r) and line feed (\ n.
In IE 8 or earlier browsers, the decimal point can match any character except the line break (\ n.
Instance code:
Instance 1:
Var str = "antzone <123"; var reg = new RegExp (". +"); console. log (str. match (reg ));
The above code matches all characters in the string.
Example 2:
Var str = "antzone <123"; var reg =/. +/; console. log (str. match (reg ));
The above code can implement the same functions above.