Is there a simple way to ignore/miss out certain letters. The problem is find a word that is 5 letters long but does not contain the letters b,j,m or n.
Can I simply only specify the letters I do want such as [a][c-i][k-l][o-2]? This doesn't appear very clean and I still need to specify the word needs to be 5 letters long. So I guess I need a /w and a {5} but am not sure how to combine it all. Thanks.
This selects all characters except bjmn:
[^bjmn]{5}
If you want only lower case letters except those you listed:
[c-ik-lo-za]{5}
If you don't want 5-letter-words that are part of longer words, add word boundary checking:
\b[c-ik-lo-za]{5}\b
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