You can achieve this will lookahead assertions
^(?=.*\bmeat\b)(?=.*\bpasta\b)(?=.*\bdinner\b).+
See it here on Regexr
(?=.*\bmeat\b)
is a positive lookahead assertion, that ensures that \bmeat\b
is somewhere in the string. Same for the other keywords and the .+
is then actually matching the whole string, but only if the assertions are true.
But it will match also on “dinner meat Foobar pasta”
Related Contents:
- Regex to replace multiple spaces with a single space
- jQuery selector regular expressions
- split string only on first instance of specified character
- Extract hostname name from string
- Regular expression to match non-ASCII characters?
- How to convert a Title to a URL slug in jQuery?
- Javascript regex returning true.. then false.. then true.. etc [duplicate]
- Insert space before capital letters
- Regex to Match Symbols: !$%^&*()_+|~-=`{}[]:”;’?,./
- javascript regex for password containing at least 8 characters, 1 number, 1 upper and 1 lowercase [duplicate]
- Including a hyphen in a regex character bracket?
- jQuery javascript regex Replace with \n
- Jquery Value match Regex [duplicate]
- jQuery remove special characters from string and more
- Regex for allowing alphanumeric,-,_ and space
- How can I select an element by ID with jQuery using regex?
- Regular expression [Any number]
- RegEx that will match the last occurrence of dot in a string
- jQuery Youtube URL Validation with regex
- Extract all email addresses from bulk text using jquery
- How to get the children of the $(this) selector?
- Using jQuery to center a DIV on the screen
- Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters
- iFrame src change event detection?
- .append(), prepend(), .after() and .before()
- change type of input field with jQuery
- Can I call jQuery’s click() to follow an link if I haven’t bound an event handler to it with bind or click already?
- jQuery vs document.querySelectorAll
- How to order events bound with jQuery
- How do I get the n-th level parent of an element in jQuery?
- jQuery Multiple ID selectors
- Convert Hex to RGBA
- Design Patterns used in the jQuery library
- Set value to currency in
- Jquery Event won’t fire after ajax call
- How to get all the values of input array element jquery [duplicate]
- Matching special characters and letters in regex
- Trigger Custom Event From Iframe To Parent Document
- IP to Location using Javascript [closed]
- Why is Chrome pausing on some line inside jQuery?
- How to completely DISABLE any MOUSE CLICK
- Inserting if statement inside ES6 template literal
- jQuery key code for command key
- jQuery min/max property from array of elements
- Scrolling Overflowed DIVs with JavaScript
- JavaScript: Invert color on all elements of a page
- How do I write a jquery function that accepts a callback as a parameter
- Turn the Tooltip Bootstrap functionality off
- Get Youtube information via JSON for single video (not feed) in Javascript
- Count the number of integers in a string