Skip to content

Instantly share code, notes, and snippets.

@diegok
Created October 16, 2012 18:06
Show Gist options
  • Save diegok/3900950 to your computer and use it in GitHub Desktop.
Save diegok/3900950 to your computer and use it in GitHub Desktop.
split!
my $slug = "bebe/mas/cosas/t/tag";
my ($real_slug, $rest) = $slug =~ m|^(.+?)(/[mt]/.*)?$|
# con tu ejemplo:
my ($real_slug) = $slug =~ /((?!\/[tm]).+)/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment