Hi,

I am trying to create a text highlighter in Qt for bash scripts using regular expressions, which I am fairly new too. My problem is seen in the code below, where I want to color all text from the first quote until the last quote before I write to file.
I also want to color the content between the quotes in the variable "Var" and the last echo, so basically the same highlighting as when opening a bash script in Gedit.

Qt Code:
  1. echo "
  2. while IFS=\"\" read -r line || [[ -n \$line ]]; do
  3. running=\$(netstat -an | grep :\$line | wc -l)
  4. sleep \"1\"
  5. if [ \"\$running\" = \"0\" ]
  6. then
  7. fi
  8.  
  9. done < \"\$file\"" >> $FILE
  10.  
  11. Var="Test"
  12.  
  13. echo ""
To copy to clipboard, switch view to plain text mode 

So far I have a regular expression looking like this:
Qt Code:
  1. ["](((?:[^"]|["](?!\s*>))+))["]
To copy to clipboard, switch view to plain text mode 
When I test this I paste it in regexr.com and it works fine for the first echo. For the variable and the last echo it colors everything from the first quote after "Var=" until the last quote after echo.

Can anyone help me complete my expression, and also how to be able to use it as a QRegExp or QRegularExpression?