Following are various examples of Logical Operators using regular expression in java.
X followed by Y.
Either X or Y.