This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
This is the Java Tutorial about regular expressions.
There is something not quite right about your regex; you are matching any character any number of times then maybe once or not at all. It is the .*? bit. All three of those characters are meta-characters; . means anything-not-line-end, * means any number including 0 and ? means 0 or 1.
Not sure exactly what you need, but I think you will find the tutorial helpful. Take some time over it; regular expressions are by no means easy. [ April 24, 2008: Message edited by: Campbell Ritchie ]