有谁知道为什么正则表达式\p{Cs}与Java 16中的符号不匹配?它曾经在 Java 11 中匹配它。
爪哇 11
jshell
| Welcome to JShell -- Version 11.0.7
| For an introduction type: /help intro
jshell> import java.util.regex.*
jshell> var text = new StringBuilder().appendCodePoint(55622).appendCodePoint(56380)
text ==>
jshell> Pattern.compile("\\p{Cs}").matcher(text).find()
$3 ==> true
Run Code Online (Sandbox Code Playgroud)
爪哇 16
INFO: Created user preferences directory.
| Welcome to JShell -- Version 16.0.1
| For an introduction type: /help intro
jshell> import java.util.regex.*
jshell> var text = new StringBuilder().appendCodePoint(55622).appendCodePoint(56380)
text ==>
jshell> Pattern.compile("\\p{Cs}").matcher(text).find()
$3 ==> false
Run Code Online (Sandbox Code Playgroud)