Thanks to automatic delimiters, one can use regular expressions without brain strain and without coming up with a suitable delimiter.
Detecting a delimitered pattern
Automatic delimiters work perfectly fine, regardless of whether you passed a delimitered pattern or not.
The code snippets above are equal.
How does T-Regx decide whether a pattern is already delimitered, or whether it's not and needs to be delimitered again?
The rule is simple.
If a pattern can be thought of, as delimitered - T-Regx assumes it's delimitered.
There are two ways of passing flags:
or use a regular delimitered pattern with a flag:
I want to break it
T-Regx has a set of predefined, suitable delimiters (like
~, etc.) and simply uses the first one,
that doesn't occur in your pattern. If you exhaust each of them; if you use every possible, predefined, suitable delimiter -
T-Regx will throw
In that case, you simply have to use an explicit, regular delimiter and automatic delimiter won't be used.