I want to extract this “SD” from text “SouthDacota (SD)” in Javascript. I am newbie to regex in js and wanted to know if any one has any ideas.
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.
The simplest regex would match the parentheses, and in between two upper-case letters. In addition you can “capture” the two letters (with unescaped parentheses), so you can retrieve them without the parentheses:
But you should really read up on some basics.