From 8769155f5efb5df114730b9eb6e07926e3941941 Mon Sep 17 00:00:00 2001 From: is Date: Fri, 4 Oct 2019 21:59:58 -0400 Subject: [PATCH] update regexp --- regexp.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/regexp.md b/regexp.md index 183a73188..79f6883fd 100644 --- a/regexp.md +++ b/regexp.md @@ -5,13 +5,12 @@ layout: 2017/sheet weight: -1 authors: - github: rizqyhi + - github: izzergh updated: 2019-03-24 description: | Basic cheatsheets for regular expression --- -## - {: .-three-column} ### Character classes @@ -63,3 +62,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` | +| `(?