Skip to content

Instantly share code, notes, and snippets.

@mshock
Created October 8, 2012 20:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mshock/3854844 to your computer and use it in GitHub Desktop.
Save mshock/3854844 to your computer and use it in GitHub Desktop.
regex truth constant
# useful to implement in many scripts that need to verify user input from CLI or config files
use constant REGEX_TRUE => qr/^\s*(?:true|(?:t)|(?:y)|yes|(?:1))\s*$/i;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment