Merge pull request #1224 from izzergh/feature/update-regexp

Add Lookahead and Lookbehind to regexp.md
This commit is contained in:
Rico Sta. Cruz 2020-01-01 10:06:57 +11:00 committed by GitHub
commit e8acd9672d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@ layout: 2017/sheet
weight: -1
authors:
- github: rizqyhi
- github: izzergh
- github: kolapsys
- github: samtrion
updated: 2019-11-14
@ -76,3 +77,12 @@ description: |
| `a{3,}` | Match 3 or more |
| `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` |