Why regular expression doesn't work in Java 11
-
I have the regular expression:
^Статья\s(?\p{N}+)\.?\s(?.+)</pre>
and a string:
<pre>Статья 1. Цели и сфера применения технического регламента</pre>
When I run here https://regex101.com/ (FLAVOR PCRE2 (PHP >= 7.3) - it does work well. But when I run this regular expression in
<pre>
root@b2fa9e8a6f7d:/app# java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)</pre>pattern.matcher(string) returns null which is wrong. Please tell me how to fix that? Or can you give me a manual about Regular Expressions dialects ?
FLAVOR PCRE2 (PHP >= 7.3) was selected intentionally because Flavor Java 8 is completely incompatible with AdoptOpenJDK-11.0.11+9</x-turndown>