When @ the linked post is written "lastSlashIndex" and "LastUndrIndex", are that funktions of painless? I did not find anything.
These are just arbitrary variable names that you can define in your script. Painless function is lastIndexOf
. I'd recommend you first go through examples, other discuss threads and API reference. Experiment with them and get back if you still have questions.
As far as I know Regexes are disabled by default in Painless, but you can use other string-based functions.
--
Oleg