From 1a17fe6148e713773555975c93f1bc6e740b26a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20St=C3=BChmer?= <3283596+samtrion@users.noreply.github.com> Date: Thu, 14 Nov 2019 16:56:16 +0100 Subject: [PATCH 1/2] Added match a single character that is not contained within the brackets. For example, [^abc] Matches a single character that is not contained within the brackets. For example, [^abc] matches any character other than "a", "b", or "c". [^a-z] matches any single character that is not a lowercase letter from "a" to "z". Likewise, literal characters and ranges can be mixed. --- regexp.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/regexp.md b/regexp.md index 183a73188..27ce9054b 100644 --- a/regexp.md +++ b/regexp.md @@ -5,7 +5,8 @@ layout: 2017/sheet weight: -1 authors: - github: rizqyhi -updated: 2019-03-24 + - github: samtrion +updated: 2019-11-14 description: | Basic cheatsheets for regular expression --- @@ -16,18 +17,19 @@ description: | ### Character classes -| Pattern | Description | -| ------- | ------------------------------ | -| `.` | Any character, except newline | -| `\w` | Word | -| `\d` | Digit | -| `\s` | Whitespace | -| `\W` | Not word | -| `\D` | Not digit | -| `\S` | Not whitespace | -| `[abc]` | Any of a, b, or c | -| `[a-e]` | Characters between `a` and `e` | -| `[1-9]` | Digit between `1` and `9` | +| Pattern | Description | +| -------- | ------------------------------- | +| `.` | Any character, except newline | +| `\w` | Word | +| `\d` | Digit | +| `\s` | Whitespace | +| `\W` | Not word | +| `\D` | Not digit | +| `\S` | Not whitespace | +| `[abc]` | Any of a, b, or c | +| `[a-e]` | Characters between `a` and `e` | +| `[1-9]` | Digit between `1` and `9` | +| `[^abc]` | Any character except a, b and c | ### Anchors From 35b68996636e5cd273da8797d168ac7acdcbc256 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Sun, 17 Nov 2019 17:00:59 +1100 Subject: [PATCH 2/2] Update formatting --- regexp.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/regexp.md b/regexp.md index 27ce9054b..3afbf1c26 100644 --- a/regexp.md +++ b/regexp.md @@ -17,19 +17,19 @@ description: | ### Character classes -| Pattern | Description | -| -------- | ------------------------------- | -| `.` | Any character, except newline | -| `\w` | Word | -| `\d` | Digit | -| `\s` | Whitespace | -| `\W` | Not word | -| `\D` | Not digit | -| `\S` | Not whitespace | -| `[abc]` | Any of a, b, or c | -| `[a-e]` | Characters between `a` and `e` | -| `[1-9]` | Digit between `1` and `9` | -| `[^abc]` | Any character except a, b and c | +| Pattern | Description | +| -------- | ------------------------------------ | +| `.` | Any character, except newline | +| `\w` | Word | +| `\d` | Digit | +| `\s` | Whitespace | +| `\W` | Not word | +| `\D` | Not digit | +| `\S` | Not whitespace | +| `[abc]` | Any of a, b, or c | +| `[a-e]` | Characters between `a` and `e` | +| `[1-9]` | Digit between `1` and `9` | +| `[^abc]` | Any character except `a`, `b` or `c` | ### Anchors