Regular expressions are a way to describe a set of strings based on common characteristics shared by each string in the set. They can be used to search, edit, or manipulate text and data. I have used Regular Expression, XSLT and XPath to generate the XML format in project.

1. Basic tutorial

Sun tutorial

Regex : Java Glossary 

2. Example 

Java Developers Almanac: regular expressions 

3. Test your code

Regular Expression Test Page