Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am very new with regexp. I would like to know the pattern defined by this regexp :


It starts with 2 alphabetic characters then 2 numeric characters then a . and * which is for 0 or several occurences of the last characters.

What I don't understand is what is the dot used for?

share|improve this question
up vote 5 down vote accepted

You should refer to this


Regular expression visualization

Debuggex Demo

It's gold mine when it comes to explain regexp. ^ stands for beginning of the line
[A-Z a-z] stands for any letter in the alphabet upper or lower case
[1-9] stands for a number between 1 and 9 included
. as mention stands for any char except end of line depending of your regexp engine

Then you need to read the graph from left to right and respect the loops indication to understand what matches and what not matches.

share|improve this answer

^ indicates the beginning of line; followed by two alphabetic characters (uppercase or lowercase), followed by two numeric characters in the range 1-9, followed by any number of characters.

share|improve this answer
And what does the dot stand for ? – user1058398 Feb 27 '14 at 14:05
. means "match any character". So, .* means "match any number of occurrences, including zero, of any character" – D_Bye Feb 27 '14 at 14:06

. matches any single character in regex

Please refer this

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.