You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val other = "^[^\u0000-\u00a0\u1680\u2000-\u200a\u202f\u205f\u3000\u2028\u2029]$"
Pattern.compile(other, Pattern.CASE_INSENSITIVE)
Gives me this error: java.util.regex.PatternSyntaxException: Unclosed character class near index 1 ^[^- - ]$ ^ at java.lang.Throwable::fillInStackTrace_class.java.lang.Throwable at java.lang.Throwable::init_class.java.lang.String_class.java.lang.Throwable at java.lang.Exception::init_class.java.lang.String_class.java.lang.Throwable at java.lang.RuntimeException::init_class.java.lang.String_class.java.lang.Throwable at java.lang.IllegalArgumentException::init_class.java.lang.String_class.java.lang.Throwable at java.lang.IllegalArgumentException::init at java.util.regex.PatternSyntaxException::init_class.java.lang.String_class.java.lang.String_i32 at java.util.regex.Pattern$::compile_class.java.lang.String_i32_bool_class.java.util.regex.Pattern at java.util.regex.Pattern$::compile_class.java.lang.String_i32_class.java.util.regex.Pattern at example.Main$::main_class.ssnr.ObjectArray_unit at main at __libc_start_main at _start at java.lang.RuntimeException: Nonzero exit code: 1 at scala.sys.package$.error(package.scala:27)
From the first glance it looks like our current regex completely ignores the fact utf-8 and utf-16 that we use for in-memory representation of strings are two completely separate beasts.
Trying to compile this code:
Gives me this error:
java.util.regex.PatternSyntaxException: Unclosed character class near index 1 ^[^- - ]$ ^ at java.lang.Throwable::fillInStackTrace_class.java.lang.Throwable at java.lang.Throwable::init_class.java.lang.String_class.java.lang.Throwable at java.lang.Exception::init_class.java.lang.String_class.java.lang.Throwable at java.lang.RuntimeException::init_class.java.lang.String_class.java.lang.Throwable at java.lang.IllegalArgumentException::init_class.java.lang.String_class.java.lang.Throwable at java.lang.IllegalArgumentException::init at java.util.regex.PatternSyntaxException::init_class.java.lang.String_class.java.lang.String_i32 at java.util.regex.Pattern$::compile_class.java.lang.String_i32_bool_class.java.util.regex.Pattern at java.util.regex.Pattern$::compile_class.java.lang.String_i32_class.java.util.regex.Pattern at example.Main$::main_class.ssnr.ObjectArray_unit at main at __libc_start_main at _start at java.lang.RuntimeException: Nonzero exit code: 1 at scala.sys.package$.error(package.scala:27)
It compiles on JVM: http://ideone.com/r2I2gm
And it does in Go, which uses re2: http://ideone.com/CGrZar
The text was updated successfully, but these errors were encountered: