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?


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.


^ 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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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