Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

In regular expressions. How to use metacharacters

Shulou Source: shulou.com Published: 2022-06-02 03:56:31 10月04日 Update

This article mainly introduces regular expressions. How to use metacharacters, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Regular expression. Symbol metacharacter:

Dot (.) Metacharacters can match any character except carriage return (\ r) and newline character (\ n).

Grammatical structure:

Constructor mode:

New RegExp (.)

Object direct quantity method:

[JavaScript] View copy code running code in plain text

/. /

Browsers support:

IE browsers support this metacharacter.

Firefox browser supports this metacharacter.

Google browser supports this metacharacter.

Note:

In browsers above IE9 or other standard browsers, the decimal point can match any character except the carriage return (\ r) and the newline character (\ n).

In browsers below IE8, the decimal point can match any character except the newline character (\ n).

Example code:

Example 1:

Var str= "antzone

Tags: Metacharacters browsing code characters support articles regular expressions instances newline characters decimals decimal points ways values interests functions functions and at the same time strings Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Linux Microsoft Redmi Shulou Tech Info