I have this regexp
Pattern pattern = Pattern.compile("\\{([^\\}]+)\\}");
to match {a1|a2|a3} and {a4} format
How can I rewrite the above line, to include those matches only when a pipe | is present, so to match {a1|a2|a3} and do not match on {a4}
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.
Add a pipe character to your regular expression: