Merge pull request #1224 from izzergh/feature/update-regexp
Add Lookahead and Lookbehind to regexp.md
This commit is contained in:
commit
e8acd9672d
10
regexp.md
10
regexp.md
|
@ -5,6 +5,7 @@ layout: 2017/sheet
|
||||||
weight: -1
|
weight: -1
|
||||||
authors:
|
authors:
|
||||||
- github: rizqyhi
|
- github: rizqyhi
|
||||||
|
- github: izzergh
|
||||||
- github: kolapsys
|
- github: kolapsys
|
||||||
- github: samtrion
|
- github: samtrion
|
||||||
updated: 2019-11-14
|
updated: 2019-11-14
|
||||||
|
@ -76,3 +77,12 @@ description: |
|
||||||
| `a{3,}` | Match 3 or more |
|
| `a{3,}` | Match 3 or more |
|
||||||
| `a{1,3}` | Match between 1 and 3 |
|
| `a{1,3}` | Match between 1 and 3 |
|
||||||
|
|
||||||
|
### Lookahead & Lookbehind
|
||||||
|
|
||||||
|
| Pattern | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `a(?=b)` | Match `a` in `baby` but not in `bay` |
|
||||||
|
| `a(?!b)` | Match `a` in `Stan` but not in `Stab` |
|
||||||
|
| --- | --- |
|
||||||
|
| `(?<=a)b` | Match `b` in `crabs` but not in `cribs` |
|
||||||
|
| `(?<!a)b` | Match `b` in `fib` but not in `fab` |
|
||||||
|
|
Loading…
Reference in New Issue