Skip to content

Instantly share code, notes, and snippets.

@technion
Created October 17, 2015 08:16
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save technion/5ca01ca420725e17cd3f to your computer and use it in GitHub Desktop.
Save technion/5ca01ca420725e17cd3f to your computer and use it in GitHub Desktop.
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
@technion
Copy link
Author

technion commented Feb 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment