Regex: Any Character Symbol

Regular Expression Any Character: .

You can use the any character reserved symbol (.) to instruct the Regular Expression pattern to match any single character.

Match '^.a'

Let’s match all lines that start with any character, but the second character must be the lowercase letter a:

grep '^.a' user.csv

Output:

grep ‘^.a’

Note

This RegEx pattern '^.a' is combining the Line Begin Anchor and the match any character symbol .. RegEx allows you to mix and match the special syntax to create highly specific patterns.

Match '[email protected]

grep '[email protected]' user.csv

Output:

grep ‘.7@example’

Note

The match any character symbol provides great flexibility for all patterns.