Skip to content

Instantly share code, notes, and snippets.

@qpfiffer
Created August 2, 2011 17:09
Show Gist options
  • Select an option

  • Save qpfiffer/1120670 to your computer and use it in GitHub Desktop.

Select an option

Save qpfiffer/1120670 to your computer and use it in GitHub Desktop.
Regex madness
$model_name =~ s/^\/(.*)\/$/$1/;
if ($model_name =~ m/([^\\]|^)\//)
{
print STDERR "Invalid model name regex.\n";
exit 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment