go to previous page   go to home page   go to next page

Answer:

|

(This is a single vertical bar.)


Bitwise OR

When two or more ints are combined with a bitwise OR, a bit that is set in any of the ints will be set in the result. The following asks for three options:

Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.DOTALL

Now, in addition to being case insensitive and working with Unicode, the dot character in the regular expression matches all characters, including end-of-line. You might want to do this when processing many lines of input from a disk file.


QUESTION 7:

Have you ever wished that regular expressions could be spaced out to make them easier to read?