I am newbie to Javascript.
What regex will be used to match the following expression type. Please note that there could be spaces between digits.
(3,2), ( 2,3),(5, 4)
I am trying as (\d+,\d) but this is not working for multiple pairs of (x,y).
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.
See the RE below:
\s*means: “any whitespace”. The parentheses have a special meaning, and have to be escaped.The first RE just matches all pairs of numbers, while the second RE also group the numbers, so that they can be referred when using the
RegExp.execfunction.Example, get all (x,y) pairs within a string, and store the pair in an array: