mirror of
https://github.com/ziishaned/learn-regex.git
synced 2025-09-07 06:07:00 -04:00
Add shorthand character sets
This commit is contained in:
parent
6b1ff1f55a
commit
84c270e189
18
README.md
18
README.md
@ -250,4 +250,20 @@ must be end of the string.
|
||||
|
||||
<pre>
|
||||
"(at.)$" => The fat cat sat on the m<a href="#learn-regex"><strong>at.</strong></a>
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
## 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]`|
|
Loading…
x
Reference in New Issue
Block a user