I'm trying to put together a regex that matches any word containing all specified letters.
For example:
a,b
Aaron: not match
Abby: match
Barry: match
Bobb: not match
Alley: not match
Abel: match
Bella: match
any ideas?
(?=\w*a)(?=\w*b)\w+
Check that there's an "a", and a "b", before you get to a space or non-word character. Then capture all the characters until the end of the word.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With