From 40f85ccefbc2db37eca4a8b158ec4fc830459368 Mon Sep 17 00:00:00 2001 From: srogljan Date: Thu, 11 Jun 2015 13:18:18 +0200 Subject: [PATCH] UNICODE_CHARACTER_CLASS fix --- core/src/main/java/org/elasticsearch/common/regex/Regex.java | 2 +- .../test/java/org/elasticsearch/common/regex/RegexTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/common/regex/Regex.java b/core/src/main/java/org/elasticsearch/common/regex/Regex.java index f5c3094e31d..061ad6c26c0 100644 --- a/core/src/main/java/org/elasticsearch/common/regex/Regex.java +++ b/core/src/main/java/org/elasticsearch/common/regex/Regex.java @@ -150,7 +150,7 @@ public class Regex { pFlags |= Pattern.LITERAL; } else if ("COMMENTS".equals(s)) { pFlags |= Pattern.COMMENTS; - } else if ("UNICODE_CHAR_CLASS".equals(s)) { + } else if (("UNICODE_CHAR_CLASS".equals(s)) || ("UNICODE_CHARACTER_CLASS".equals(s))) { pFlags |= UNICODE_CHARACTER_CLASS; } else { throw new IllegalArgumentException("Unknown regex flag [" + s + "]"); diff --git a/core/src/test/java/org/elasticsearch/common/regex/RegexTests.java b/core/src/test/java/org/elasticsearch/common/regex/RegexTests.java index 380bf90ad5f..ea77dd73c97 100644 --- a/core/src/test/java/org/elasticsearch/common/regex/RegexTests.java +++ b/core/src/test/java/org/elasticsearch/common/regex/RegexTests.java @@ -31,7 +31,7 @@ public class RegexTests extends ElasticsearchTestCase { @Test public void testFlags() { String[] supportedFlags = new String[]{"CASE_INSENSITIVE", "MULTILINE", "DOTALL", "UNICODE_CASE", "CANON_EQ", "UNIX_LINES", - "LITERAL", "COMMENTS", "UNICODE_CHAR_CLASS"}; + "LITERAL", "COMMENTS", "UNICODE_CHAR_CLASS", "UNICODE_CHARACTER_CLASS"}; int[] flags = new int[]{Pattern.CASE_INSENSITIVE, Pattern.MULTILINE, Pattern.DOTALL, Pattern.UNICODE_CASE, Pattern.CANON_EQ, Pattern.UNIX_LINES, Pattern.LITERAL, Pattern.COMMENTS, Regex.UNICODE_CHARACTER_CLASS}; Random random = getRandom();