首页 > 其他 > 详细

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

时间:2016-03-05 23:25:29      阅读:280      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!