正则表达式是一个查找和替换字符串的强有力的工具。
- 模式(Patterns)和修饰符(flags)
- Character classes
- Unicode: flag "u" and class \p{...}
- Anchors: string start ^ and end $
- Flag "m" — 多行模式
- Word boundary: \b
- 转义,特殊字符
- 集合和范围 [...]
- 量词 `+,*,?` 和 `{n}`
- 贪婪量词和惰性量词
- Capturing groups
- Backreferences in pattern: \N and \k<name>
- 选择(OR)|
- 前瞻断言与后瞻断言
- Catastrophic backtracking
- Sticky flag "y", searching at position
- Methods of RegExp and String