I have patterns: a, abb, a*b+. And I need to combine them to use in a one match operation and to have information of which the pattern correspond to the input string. Can I do this by means of JDK libraries?
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.
I assume you’re talking about regexes.
Just use
ors:You can tell which pattern was matched from the index of the group that matched.