I learned all my Regex from this website: http://www.zytrax.com/tech/web/regex.htm. Google on 'Regex tutorials' and you'll find loads of helful articles.
String regex = "[a-zA-Z]*\.jpg";
System.out.println ("somthing.jpg".matches (regex));
returns true.