Suppose I had the string
1122345
There are two pairs in this string. What’s the regular expression for counting the pairs in this string?
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.
Try out this:
please modify the above regex according to your problem.pattern matching if the user enters same digit. \1 matches the first capture group, so the pattern matches whether the digits are repeated in the string.