Thread: Regex examples
View Single Post
Old 08-15-2013, 01:17 PM   #280
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,692
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Consider replacing [a-z] with \p{Ll}

That way, lower case unicode characters can be matched as well. You never know when a random "é" or "á" will bite you in the butt (and not just in the above regex).

[a-zA-Z] becomes \p{L}
[a-z] becomes \p{Ll}
[A-Z] becomes \p{Lu}
DiapDealer is offline   Reply With Quote