Created
October 17, 2015 08:16
-
-
Save technion/5ca01ca420725e17cd3f 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
def instacheck(name) | |
unless /[a-z0-9._]{,30}/.match(name) | |
return false | |
end | |
if /\.\./.match(name) | |
return false | |
end | |
if /^\d+$/.match(name) | |
return false | |
end | |
if /^\./.match(name) | |
return false | |
end | |
true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My regex did no include any such characters. I can't comment on subsequent advice from anyone else. My code already checked for leading dots and did not fail any tests people brought up relating to someone elses code.