How do I replace all but what’s within parenthesis
For instance:
some_html=some_html.gsub(/<a href=\"([^\"]+)\"/, "");
now I would like to replace that string with: whatever is in the parenthesis.
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.
I don’t really understand your question, so if it needed feel free to correct me.
I assume you need to transform following
<a href="needless[target]trash"into something like<a href="target"So following code do the job: