1 |
Simple Single-character Patterns are :
-
Single explicit character eg a
-
dot . which matches ANY character except newline \n
|
2 |
Character class is a Single-character Patterns and represented as a set [c1c2c3...cN] which matches any one of the listed characters
-
[ABCDE] matches A B C D or E
-
[0-9] is same as [0123456789]
-
[a-zA-Z] matches any lower or upper case letter
|
3 |
Negated character class is represented by a carat ^ after left [ square bracket
-
[^0-9] matches any character which is NOT
-
a digit 0 1 2 3 4 5 6 7 8 9
|