I have:
Pattern pat = Pattern.compile("(\\d+) (\\d+) (1$)");
Matcher mat = pat.matcher(line);
with matches for:
1 2 1
but not for:
1 2 1
How can I achieve, that pattern matching is insenitive according to spaces between numbers?
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.
Use
\sfor one space and add a+that means one ore more spaces.If you want zero or more spaces you have to use a
*instead of the+.