Regular Expression Characters


1. Match Any Single character (.)
The “ . “ character matches any single character. For example, “…” will match “12B”, “B3B”, “123”, “ABC”, “$g%” etc…
   
2. Match Any single character in list [xyz]
A character list inside square brackets matches any of the single characters in the list. For example, “[abc][12]” will match “a1”, “a2”, “b1”, “b2”, “c1” and “c2”

3. Match any single character Not in a list [^xyz]
The “^” character is a negation character used to exclude a pattern from the regular expression. For example, “[^a][12]” will not match “a1” and “a2” but will match “11”, “12”, “c1” etc………

4. Match Any single character within a Range ( [x-y] )
The “[d-h]” construct will match any character ranging from d to h. For example, “[abcdef][123]” can also be written as “[a-f][1-3]”

5. Match zero or More specific characters ( * )
The  “*” character is used to match zero or more occurrences of a regular expression that precedes the star. For example, “a*” will match a blank string, “a”, “aa”, “aaa” etc…

“aa*” will match “a”, “aa”, “aaa” etc

“[abc][1-4]*” will match “a”, “b”, “c”, “a1”, “b1”, “a12”, “b12”, “a1234344” etc…

“User.*” will match any string starting with text “User”

6. Match one or more specific characters ( + )
The “+” character is used to match one or more occurrences of a regular expression that precedes the plus sign. For exampale “aa*” can also be written as “a+”

“123+” will match “123”, “1233”, “12333” etc…

“[123]+” will match “1”, “2”, “3”, “12”, “23” etc…

7. Match zero or one specific character ( ? )
A “?” character is used to match zero or one occurrences of a preceding regular expression. For example, “a[123]?” will match “a”, “a1”, “a2” and “a3”