php - regular expressions missing out certain letters -
is there simple way ignore/miss out letters. problem find word 5 letters long not contain letters b,j,m or n.
can specify letters want such [a][c-i][k-l][o-2]? doesn't appear clean , still need specify word needs 5 letters long. guess need /w , {5} not sure how combine all. thanks.
this selects characters except bjmn:
[^bjmn]{5}
if want lower case letters except listed:
[c-ik-lo-za]{5}
if don't want 5-letter-words part of longer words, add word boundary checking:
\b[c-ik-lo-za]{5}\b
Comments
Post a Comment