Home > Web Front-end > JS Tutorial > body text

JavaScript Study Notes (11) Introduction to Regular Expressions_Basic Knowledge

WBOY
Release: 2016-05-16 17:52:37
Original
978 people have browsed it

1. Modifier
. Any character
* matches * the preceding 0 or more characters
matches the preceding one or more characters
? matches ? the preceding 0 or 1 character
^ is preceded by the character after ^
$ ends by the character before $
[] matches a character within []
() grouping, you can use 1 2 to extract
[^] matches ^ Characters other than the ones after
{n} There are n characters before {n}, n is a positive number
{n,} {n,} There are at least n characters before it, n is a positive number
{n,m} There are n~m characters before {n,m}, n,m is a positive number

2. Characters
d a number
D a non-number
w a letter or number
W a non-letter and non-number
s a whitespace character
S a non-whitespace character
b word boundary
B non-word boundary

3. Non-greedy matching
? *? ??

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template