I'm trying to match only arabic text using regex but I'm getting an exception. Here's my code:
txt.matches("\\P{Arabic}+")
Here's the exception:
Exception in thread "main" java.util.regex.PatternSyntaxException: Unknown character property name {Arabic} near index 9 \P{Arabic}+
Use this character block
\p{InArabic}+
In java Unicode scripts, blocks, categories and binary properties are written with the \p
and \P
(negated effect)
Is
or by using the script
keyword(supported scripts)In
or by using the keyword block
(supported blocks)Is
or using keyword general_category
or gc
(supported categories)Is
(supported properties)REFERECE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With