Is there a regex to split boolean string by boolean operator but not within quotes
example: boolean_string = "'larsen and turbo' and fullsta'ck or \"ruby\" and \"ruby or rails\""
expected output: ['larsen and turbo', and, fullsta'ck, or, ruby, and, ruby or rails]
Currently trying with below code snippet but unable to escape operators within quotes.
boolean_string.split(/\b(and|or)\b/)
How do I escape and and or's within quotes.`