Lets say I have multiple patterns P1, P2, P3,, and so on. These patterns are different Regex patterns to match different variations of DATE.
How do I match these for
To complement the other answers...
You can write one big, hard-to-read pattern using the alternation operator:
r1|r2|r3|...|rn
where r1 etc are themselves "fully-fleged" regexes.
However you have to be careful about the order of alternations: the first to match wins. That is, if the regex engine is not a POSIX regex engine but java.util.regex's engine isn't.
Therefore, with text catflap, using regex:
cat|catflap
Java will match cat; a POSIX regex engine will match catflap (the longest, leftmost match).
Sticking with more individual, maintainable patterns is imho a better option.