OpenSearch/modules
Nik Everett 257a7d77ed Painless: Fix regex lexer and error messages (#23634)
Without this change, if write a script with multiple regexes
*sometimes* the lexer will decide to look at them like one
big regex and then some trailing garbage. Like this discuss post:
https://discuss.elastic.co/t/error-with-the-split-function-in-painless-script/79021

```
def val = /\\\\/.split(ctx._source.event_data.param17);
if (val[2] =~ /\\./) {
  def val2 = /\\./.split(val[2]);
  ctx._source['user_crash'] = val2[0]
} else {
  ctx._source['user_crash'] = val[2]
}
```

The error message you get from the lexer is `lexer_no_viable_alt_exception`
right after the *second* regex.

With this change each regex is just a single regex like it ought to be.

As a bonus, while looking into this issue I found that the error
reporting for regexes wasn't very nice. If you specify an invalid
pattern then you get an error marker on the start of the pattern
with the JVM's regex error message which attempts to point you to the
location in the regex but is totally unreadable in the JSON response.

This change fixes the location to point to the appropriate spot
inside the pattern and removes the portion of the JVM's error message
that doesn't render well. It is no longer needed now that we point
users to the appropriate spot in the pattern.
2017-03-22 15:56:17 -04:00
..
aggs-matrix-stats [TEST] improve yaml test sections parsing (#23407) 2017-03-02 12:43:20 +01:00
ingest-common Upgrade checkstyle to version 7.5 2017-02-03 09:46:44 -05:00
lang-expression Upgrade to lucene-6.5.0-snapshot-d00c5ca (#23385) 2017-02-27 18:39:04 +01:00
lang-mustache Mustache: don't extend AbstractComponent (#23419) 2017-03-01 14:54:27 -05:00
lang-painless Painless: Fix regex lexer and error messages (#23634) 2017-03-22 15:56:17 -04:00
percolator Revert "Internal: Change version constant names for already released versions (#23416)" 2017-02-28 14:45:13 -08:00
reindex Reindex: wait for cleanup before responding (#23677) 2017-03-21 15:33:39 -04:00
repository-url Build: Rework integ test setup and shutdown to ensure stop runs when desired (#23304) 2017-02-22 12:43:15 -08:00
transport-netty4 Upgrade to Netty 4.1.9 2017-03-11 18:28:31 -08:00
build.gradle Build: Change `gradle run` to use zip distribution (#21001) 2016-10-18 11:48:58 -07:00