Created
January 31, 2012 05:56
-
-
Save IceskYsl/1709101 to your computer and use it in GitHub Desktop.
判断一个字符串只有英文,数字和冒号的正则
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STR_REGEXP = /[a-zA-Z0-9:]/ | |
str = "iceskysl...balalal" | |
if str =~ UNICODE_STR_DLD_REGEXP | |
puts "==bad str: #{str}" | |
else | |
puts "ok......pass" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment