Hi there,
at https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-painless.html you show some examples of how to use regex in a painless script. In those examples you are never using m.matches() before you call "group" or "replaceAll". I ran into a really confusing issue today, where without calling "matches" before I was not having any matching result. Is the documentation wrong or should it really be working without calling "matches" beforhands.
If it should be working without "matches", following script did not return any match to me:
"transform" : {
"script" : {
"inline" : "ctx.payload.action = /(.*)/.matcher('action'); return ctx.payload"
}
}
"action": "java.util.regex.Matcher[pattern=(.*) region=0,6 lastmatch=]",
Thanks!
Andreas