Parse and capture each value using a Pattern/Matcher and use a a Set to check for duplicates.
Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)
The Set Interface (The Java™...