I would like to filter out all words containing 1 number and 3 capital letters with a total length of 4. See my example here: http://gskinner.com/RegExr/?32taa
A
Your code has two issues:
Your pattern is wrong, as it allows more digits - see http://regexr.com?32u3e
Java requires double escape slashes...
Use regex pattern
\\b(?=[A-Z]*\\d[A-Z]*\\b)[A-Z\\d]{4}\\b