The following regex with grep doesn't seem to be working:
grep "(?=\_\(\").*?(?=\"\))" ./testfile.js
testfile.js is as follows:
asoijf oaisdjf _("string 1") fodijsasf _("string 2")
fasdoij _("string 3");
console.log(_("string 4"));
My aim is to grab all the strings enclosed in _() function calls, without greps -P flag (the option doesn't exist for me). Expected output would be:
string 1
string 2
string 3
string 4
Any idea's?
Update: The -P flag was removed from bash in my version of mac (see grep -P no longer works how can I rewrite my searches)