java - Regular Expression that does not match a given sequence -
i need regular expression matches text description:
"any sequence not f (upper case only) followed run of 1 or more digits (0-9)".
this needs go input java's scanner.usedelimiter().
suppose input line this:
f8 has pretty solid open source cred: in f12 founded f25, f44 of f1 , f121, , helped pave way f99.
the tokenizer class scanner should retrieve f8, f12, f25, f44, f1, f121 , f99 me.
alternately, java allow negating given regex?
use pattern , matcher classes fetch chars want.
matcher m = pattern.compile("\\bf\\d+").matcher(s); while(m.find()) { system.out.println(m.group()); }
Comments
Post a Comment