How to write embedded flag expression?
It's also possible to enable various flags using embedded flag expressions. Embedded flag expressions are an alternative to the two-argument version of compile, and are specified in the regular expression itself. The example below is use
(?i) flag expression to enable case-insensitive matching.
Another flag expressions are listed below:
(?x), equivalent with
(?m), equivalent with
(?s), equivalent with
(?u), equivalent with
(?d), equivalent with
The result of the program is:
Text "The" found at 0 to 3.
Text "the" found at 31 to 34.