Lesson Notes:
abc… | letters |
---|---|
123… | digits |
\d | Any Digit |
\D | Any Non-digit character |
. | Any Character |
\. | Period |
[abc] | Only a, b, or c |
[^abc] | Not a, b nor c |
[a-z] | Characters a to z |
[0-9] | Numbers 0 to 9 |
\w | Any Alphanumeric character |
\W | Any Non-alphanumeric character |
{m} | m Repetitions |
{m,n} | m to n Repetitions |
* | Zero or more repititions |
+ | One or more repititions |
? | Optional character |
\s | Any Whitespace |
\S | Any Non-whitespace character |
^…$ | Starts and ends |
(…) | Capture Group |
(a(bc)) | Capture Sub-group |
(.*) | Capture all |
(abc|def) | Matches abc or def |
\b | Martches the boundary between a word and a non-word character |
\0,\1,\2… | Reference your captured groups |
文档信息
- 本文作者:weownthenight
- 本文链接:https://weownthenight.github.io/2021/06/02/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)