I have a need to compile a regex defined by a parameter in Painless.
My initial assumption would be that I could do something similar to the following:
Pattern p = Pattern.compile(params.myPattern);
However, I am getting the following error:
Caused by: java.lang.IllegalArgumentException: Unknown call [compile] with [1] arguments on type [Pattern].
Perhaps there is another way to convert a string into a Pattern object in Painless?