Well, sure. The pattern
Code:
"MAIL\\s+FR{0,1}O{0,1}M:"
says:
Code:
MAIL == literally
\\s+ == one or more spaces
F == literally
R{0,1} == an optional letter R
O{0,1} == an optional letter O
M: == literally
There are a couple of ways to solve this:
That makes the *group* RO optional. And that certainly works.
But my own preference would be K.I.S.S.
Code:
"MAIL\\s+(FM|FROM)M:"
That says "FM" or "FROM" as choices.
p.s.: No reason to ever use {0,1} when ? means the same thing.