From 84c270e189cc188381c735ff47f5dac17628e908 Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmed Date: Mon, 24 Jul 2017 12:04:25 +0100 Subject: [PATCH] Add shorthand character sets --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c09fc6d..f7a1ca4 100644 --- a/README.md +++ b/README.md @@ -250,4 +250,20 @@ must be end of the string.
 "(at.)$" => The fat cat sat on the mat.
-
\ No newline at end of file + + +## 3. Shorthand Character Sets + +Regular expression provides shorthands for the commonly used character sets, which offer convenient shorthands for commonly used +regular expressions The shorthand character sets are as follows: + +|Shorthand|Description| +|:----:|----| +|.|Any character except new line| +|\w|Matches alphanumeric characters: `[a-zA-Z0-9_]`| +|\W|Matches non-alphanumeric characters: `[^\w]`| +|\d|Matches digit: `[0-9]`| +|\D|Matches non-digit: `[^\d]`| +|\s|Matches whitespace character: `[\t\n\f\r\p{Z}]`| +|\S|Matches non-whitespace character: `[^\s]`| +|\c|Matches non-whitespace character: `[^\s]`| \ No newline at end of file