Reputation: 31
I want to convert the below XSD regular expression into equivalent Java regex
XSD Regex is ([\p{L}\p{Nd}\p{Z}\p{P}]){1,255}
Would you please suggest
Upvotes: 0
Views: 318
Reputation: 10136
Double up the backslashes to embed the regex in a Java string
String regexStr = "([\\p{L}\\p{Nd}\\p{Z}\\p{P}]){1,255}";
Pattern regex = Pattern.compile(regexStr);
Upvotes: 1