Regular expression constants are directly supported. To ensure fast performance, this is the only mechanism for creating patterns. Regular expressions are always constants and compiled efficiently a single time.
Pattern p = /[aeiou]/
You can define flags on patterns in Painless by adding characters after the
/foo \w #comment/iUx. Painless exposes all of
the flags from Java’s
Pattern class using these characters:
DOTALL (aka single line)
COMMENTS (aka extended)