regexp: Update formatting
This commit is contained in:
parent
aaa1f64e65
commit
f79ab86a2c
21
regexp.md
21
regexp.md
|
@ -5,15 +5,19 @@ layout: 2017/sheet
|
|||
weight: -1
|
||||
authors:
|
||||
- github: rizqyhi
|
||||
updated: 2018-10-26
|
||||
updated: 2019-03-24
|
||||
description: |
|
||||
Basic cheatsheets for regular expression
|
||||
---
|
||||
|
||||
### Character Classes
|
||||
##
|
||||
|
||||
{: .-three-column}
|
||||
|
||||
### Character classes
|
||||
|
||||
| Pattern | Description |
|
||||
| --- | --- |
|
||||
| ------- | ------------------------------ |
|
||||
| `.` | Any character, except newline |
|
||||
| `\w` | Word |
|
||||
| `\d` | Digit |
|
||||
|
@ -28,14 +32,14 @@ description: |
|
|||
### Anchors
|
||||
|
||||
| Pattern | Description |
|
||||
| --- | --- |
|
||||
| ------- | ---------------- |
|
||||
| `^abc` | Start with `abc` |
|
||||
| `abc$` | End with `abc` |
|
||||
|
||||
### Escaped Characters
|
||||
### Escaped characters
|
||||
|
||||
| Pattern | Description |
|
||||
| --- | --- |
|
||||
| ---------- | -------------------------------------- |
|
||||
| `\. \* \\` | Escape special character used by regex |
|
||||
| `\t` | Tab |
|
||||
| `\n` | Newline |
|
||||
|
@ -44,13 +48,13 @@ description: |
|
|||
### Groups
|
||||
|
||||
| Pattern | Description |
|
||||
| --- | --- |
|
||||
| ------- | ------------- |
|
||||
| `(abc)` | Capture group |
|
||||
|
||||
### Quantifiers
|
||||
|
||||
| Pattern | Description |
|
||||
| --- | --- |
|
||||
| -------- | --------------------- |
|
||||
| `a*` | Match 0 or more |
|
||||
| `a+` | Match 1 or more |
|
||||
| `a?` | Match 0 or 1 |
|
||||
|
@ -58,3 +62,4 @@ description: |
|
|||
| `a{,3}` | Match up to 3 |
|
||||
| `a{3,}` | Match 3 or more |
|
||||
| `a{1,3}` | Match between 1 and 3 |
|
||||
|
||||
|
|
Loading…
Reference in New Issue