标签:
Using a character set repeated 1 or more times, make a pattern to search for strings that do not contain the characters ‘a‘, ‘e‘, ‘i‘, ‘o‘, ‘u‘, and ‘y‘.
/[^aeiouy]+/gi
Next, surround our pattern with a word boundary on each side.
/\b[^aeiouy]+\b/gi
But wait, our pattern is considering strings containing white space to be misspelled words. Add the white space to the characters we wish to not match.
/\b[^aeiouy\s]+\b/gi
-----------------------------------------
-------------------------------
[Regex Expression] Tagline --- {0, } {1,10}
标签:
原文地址:http://www.cnblogs.com/Answer1215/p/5246021.html