Reputation: 366
I need to be able to match the word "internet" outside of quotations. e;g
Internet "InternetFormula works and it's internetformula"
Internet "The internet works"
But I have no idea how to do so as Regular Expressions is complicated, and I can't find anything like it.
Upvotes: 3
Views: 765
Reputation: 4953
According to The Greatest Regex Trick Ever
, you could use simply the following:
"[^"]*"|\b(Internet)\b
All credits goes to Nathan Tuggy
for the link
Upvotes: 1
Reputation: 67968
\bInternet\b(?=(?:[^"]*"[^"]*")*[^"]*$)
You can try this.See demo.
https://www.regex101.com/r/fG5pZ8/22
Upvotes: 5