i need to match only text into “”.
I tried with this code, but dosen’t works 🙁
text = ""This is an example text to be mathed""
text.scan(/^(")$(")/)
Thanks in advance.
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.
So your example doesn’t work because your string is malformed. That is, “”boo”” isn’t a Ruby string. You could use single quotes to make a string with double quotes in it and do the match, like so: