I’m sure this is really simple but I haven’t been able to create one that works.
I need a regular expression to extract a one or two digit number 1-13 from a string such as “(11)” or “(3)”
Thanks 🙂
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.
will match a two digit number between 1 and 13, wherever it may be (as long as it’s not part of a longer number or within a word).
If you want to hard-code the parentheses, it’s
and if you want to find more than one match in a single string, use the
gmodifier (after the last slash).