mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-02 17:09:18 +00:00
Adds support for the find operator (=~) and the match operator (==~) to painless's regexes. Also whitelists most of the Matcher class and documents regex support in painless. The find operator (=~) returns a boolean that is the result of building a matcher on the lhs with the Pattern on the RHS and calling `find` on it. Use it like this: ``` if (ctx._source.last =~ /b/) ``` The match operator (==~) returns boolean like find but instead of calling `find` on the Matcher it calls `matches`. ``` if (ctx._source.last ==~ /[^aeiou].*[aeiou]/) ``` Finally, if you want the actual matcher you do: ``` Matcher m = /[aeiou]/.matcher(ctx._source.last) ```