Merge pull request #11598 from srogljan/master

UNICODE_CHARACTER_CLASS fix
This commit is contained in:
Isabel Drost-Fromm 2015-12-11 11:53:35 +01:00
commit 8dad4d03f4
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ public class Regex {
pFlags |= Pattern.LITERAL; pFlags |= Pattern.LITERAL;
} else if ("COMMENTS".equals(s)) { } else if ("COMMENTS".equals(s)) {
pFlags |= Pattern.COMMENTS; 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; pFlags |= UNICODE_CHARACTER_CLASS;
} else { } else {
throw new IllegalArgumentException("Unknown regex flag [" + s + "]"); throw new IllegalArgumentException("Unknown regex flag [" + s + "]");

View File

@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.equalTo;
public class RegexTests extends ESTestCase { public class RegexTests extends ESTestCase {
public void testFlags() { public void testFlags() {
String[] supportedFlags = new String[]{"CASE_INSENSITIVE", "MULTILINE", "DOTALL", "UNICODE_CASE", "CANON_EQ", "UNIX_LINES", 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, 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}; Pattern.UNIX_LINES, Pattern.LITERAL, Pattern.COMMENTS, Regex.UNICODE_CHARACTER_CLASS};
Random random = getRandom(); Random random = getRandom();