Is there a way to use \p{Punct} in a regex in java, but without the two characters ( and ) ?
Is there a way to use \p{Punct} in a regex in java, but without
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be able to use:
What this is saying is:
The
^character specifies a negative character class. The&&is an intersection between thepunctclass and the custom class for the parenthesis.Have a look at the
PatternJavadocs for more info.