Really easy regex question (or two) - ORF Forums

Really easy regex question (or two) RSS Back to forum


Besides the obvious question ("is there a utility that can take your English words and turn them into a logical regex expression")...

I ask you this: can you help me with building a regex (and understanding how it works - I learn by example) which says:

"match any amount of letters followed by any two numbers followed by any one letter followed by @ followed by anything else"

by Bryon 7 years ago

@Bryon: As for the tool, I personally prefer the expression builder feature of Expresso ( Others prefer Regex Coach (, try both and see which of them you find more suitable.

As for understanding how regexes work, I recommend this tutorial:

And finally, as for the regex, the following should work:


It means any letters, either upper- or lowercase ([a-zA-Z]), any number of repetitions (*) followed by any number (\d) exactly two times ({2}) followed by any letter ([a-zA-Z]) followed by @ followed by any character (.) any number of repetitions (*).

by Krisztian Fekete (Vamsoft) 7 years ago
(in reply to this post)


Or, if by "letters" you mean basically any characters BUT numbers, use

\D*\d{2}\[email protected]*

\D means "not a digit", this will match characters like questionmark (?) or the number sign (#) as well.

by Krisztian Fekete (Vamsoft) 7 years ago

Wow expresso is exactly what i was looking for - i'll learn this utility

Thanks for the expression and explanation there - the aspects i have trouble with are the placement of the modifiers. For example "*[a-zA-Z]" is what logically makes sense to me in that the letters would modify the wildcard... but i understand how it's actually the * that modifies the group of letters

I'll learn this stuff eventually though :) regex is incredibly powerful if you know how to use it.

Thanks for putting up with all my questions over the years

by Bryon 7 years ago

You are welcome :) That is what we are here for, so if any further questions arise, ask anytime.

by Krisztian Fekete (Vamsoft) 7 years ago

New comment

Fill in the form below to add a new comment. All fields are required. If you are a registered user on our site, please sign in first.

It will not be published.
hnp1 | hnp2