Users provide keywords separated by spaces through an input box, and I would like to see if they all exist in a certain text. So for example if a user provides "flex awesome" or "awesome flex" they should both match the phrase "flex is quite awesome". The following regex won't work because it is order dependent: .*keyword1.*keyword2.*
Is there a way to tell the regex to search the entire string from the beginning for each keyword? Currently I am looping through each keyword and testing them separately - if all tests pass then I return true, but that seems wasteful. Thanks, Baz