'Better teach one to fish rather than give him some fish'
Regarding regular expressions, my advise would be:
- describe precisely what you want as output; describe it with
words, not by a non-exhaustive example
Applied to your specific example, this would give:
In any part of my input, find:
A sequence of any letter (capital or not) of any length, followed by a dot, followed by a sequence of any digit of any length
- use a tool to translate your description into a valid regular expression. I personnaly use
Expresso[
^] for that; this tool allows you to construct your regular expression using a graphical user interface, which is not luxury when the complexity of this expression starts growing. It also allows you to test your regular expression against several inputs, and validate it.
Just my 2 cents; hope this helps :) Good luck.