Test, validate and match regular expressions
This regex tokenizes search query strings by matching bracketed [...] groups (including those followed by another bracket, or not followed by & / | boolean operators), as well as non-empty word sequences followed by whitespace when more words come after. It's designed for parsing boolean search expressions, splitting queries into terms while treating & and | as operators/delimiters. Used with the global flag, it extracts all tokens from the input.