Here's an example of a regular expression that can be used to determine if a string contains all terms from a given set in any order:
main.cs703 chars24 lines
In this example, we use a positive lookahead to check for each term in the term set. The \\b
characters are used to match word boundaries, which ensures that we only match complete terms and not partial matches within larger words.
gistlibby LogSnag