I am looking for a string within quotation marks where the word Linux occurs somewhere between parentheses which reside somewhere inside the quotation marks. I have to use a regular expression to do that. I am required to do it in a Linux OS (using Virtual Box Terminal). I used the following regex:
egrep "\"([^"]*)?\(([^"]*)?Linux([^"]*)?\)([^"]*)?\"" [FILE]
But the problem is, I get
bash: syntax error near unexpected token '("
every time. What can be the problem? I tried this regex in "http://regexr.com/" it works fine, there is nothing wrong with the regex. But the Linux shell always produces the same problem... I used "\" in front of parentheses because they are metacharacters. The same thing I did in front of double quotes... But it does not work. Could anybody help me, please?