I want to fetch all the strings between _(” “) from my file.
How may i fetch that?
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.
Assuming there are no quotation marks nested within the string you’re looking for, you want to load the file into a string
Then scan the string using a regular expression. The following regular expression should do the trick. It looks for the characters
_("(the open parentheses here is escaped, because parentheses have a special meaning in regular expressions). The next parentheses starts a capturing group (so that the text of the string will be stored in the special variable$1. Then it finds a string of consecutive characters until the first quotation mark. Then it ends the capturing group (with an unescaped close parentheses) looks for a")to finish the expression.To use it