See Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes). The String class offers a few functions to replace and match using regular expressions, but capturing groups is best done...