码迷,mamicode.com
首页 > 其他好文 > 详细

[Regex Expression] Tagline --- {0, } {1,10}

时间:2016-03-05 23:26:08      阅读:279      评论:0      收藏:0      [点我收藏+]

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!