Need Regular Expression (regex) help [Java]

view story

http://www.linuxquestions.org – I've been laboring for a while trying to figure out how to augment an existing regular expression statement that can be used to extract an ID from a target string. I'm using a Java program (see below) to test the various permutations that the target string may appear as. Examples of the target string are: Code: PG: Text AB123: Other text Pg: Text Text DA321: Other text pG: FG987: Other text PG: [bracketed text] Text 123AB: Other text pg: [bracketed text] HG456: Other text The entry of interest in each of the strings above is the ID (e.g. AB123, DA321, FG987, etc). Here's the program (HowTos)