The regex String :
"[Ff][uU][Nn][Cc] "
Matches input:
"fUnC "
But not:
"func across( a, b )"
And I don't understand why...
I'm testing my expressions here: http://www.regexplanet.com/simple/index.html
I figured out that I (dumbly) needed my regex to be "[Ff][uU][Nn][Cc] .*" for a match.
SOLVED: Don't use the convenience method Pattern.Matches(regex, input) if you are looking for what amounts to a submatch. You should use the Matcher.find() method instead.