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:
- Regular expression to match non-ASCII characters?
- jQuery selector regular expressions
- Including a hyphen in a regex character bracket?
- Extract hostname name from string
- Regex to replace multiple spaces with a single space
- split string only on first instance of specified character
- Remove whitespace and line breaks between HTML elements using jQuery
- How to pull the file name from a url using javascript/jquery?
- Get URL from background-image Property
- jQuery Youtube URL Validation with regex
- Wrap tags around http text
- javascript regex for password containing at least 8 characters, 1 number, 1 upper and 1 lowercase [duplicate]
- Javascript regex returning true.. then false.. then true.. etc [duplicate]
- Regex to Match Symbols: !$%^&*()_+|~-=`{}[]:”;’?,./
- Insert dash after every 4th character in input
- Regular expression with the cyrillic alphabet
- Is there a RegExp.escape function in JavaScript?
- jQuery $(document).ready and UpdatePanels?
- jQuery click events firing multiple times
- Check whether a string matches a regex in JS
- Removing all script tags from html with JS Regular Expression
- How do I add an “Add to Favorites” button or link on my website?
- How to replace remapColums with remapColumnsByName in free jqgrid
- Uncaught TypeError: Cannot read property ‘msie’ of undefined – jQuery tools
- Get list of data-* attributes using javascript / jQuery
- How can I get selector from jQuery object
- Resize event for textarea?
- JQuery document.ready vs Phonegap deviceready
- Is it possible to check dimensions of image before uploading?
- jQuery .find() doesn’t return data in IE but does in Firefox and Chrome
- Does .css() automatically add vendor prefixes?
- jQuery text() and newlines
- In Bootstrap open Enlarge image in modal
- Is there any cross-browser javascript for making vh and vw units work
- How to use jQuery to select a dropdown option?
- keyCode values for numeric keypad?
- escaping question mark in regex javascript
- jQuery Selector + SVG Incompatible?
- When using jQuery on(), why use (document) vs. the element itself?
- this.href vs $(this).attr(‘href’)
- pure javascript to check if something has hover (without setting on mouseover/out)
- How does !!~ (not not tilde/bang bang tilde) alter the result of a ‘contains/included’ Array method call?
- Detect browser wrapped lines via javascript
- jQuery: Evaluate script in ajax response
- How to convert milliseconds into a readable date?
- Calculate Position of selected text javascript/JQuery?
- Determine if ajax call failed due to insecure response or connection refused
- Add a transform value to the current transforms that are already on the element?
- How to scroll to an element in jQuery?
- How to post ASP.NET MVC Ajax form using JavaScript rather than submit button