-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
layout: post | ||
title: 正则表达式语法 | ||
tags: 正则表达式 | ||
author: neal | ||
|
||
--- | ||
* content | ||
{:toc} | ||
dss | ||
|
||
| 字符 | 描述 | | ||
| ---- | ------------------------------------------------------------ | | ||
| $ | **匹配结尾** 如果设置了 RegExp 对象的 Multiline 属性,则 $ 也匹配 '\n' 或 '\r'。要匹配 $ 字符本身,请使用 \$。 | | ||
| () | **表示一个子表达式** | | ||
| * | **匹配前面的子表达式0到多次** | | ||
| + | **匹配前面的子表达式1到多次** 和`*` 注意区分 | | ||
| . | **匹配除换行符 `\n` 之外的任意单个字符** 针对单个 | | ||
| [] | **表达式,和`()`区别是 [] 只匹配单个字符** | | ||
| ? | **匹配前面的子表达式0次或1次** 注意和 `*`,`+` 做区分 | | ||
| \ | **转义符** | | ||
| {} | **范围限定符,描述出现频率范围** 例如:ab{0,3} 表示 b最多出现3次,最少出现0次 | | ||
| \| | **或** | | ||
|