Skip to content

Instantly share code, notes, and snippets.

@IceskYsl
Created January 31, 2012 05:56
Show Gist options
  • Save IceskYsl/1709101 to your computer and use it in GitHub Desktop.
Save IceskYsl/1709101 to your computer and use it in GitHub Desktop.
判断一个字符串只有英文,数字和冒号的正则
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