Skip to content

Instantly share code, notes, and snippets.

@ejhayes
Created March 6, 2012 03:02
Show Gist options
  • Save ejhayes/1983135 to your computer and use it in GitHub Desktop.
Save ejhayes/1983135 to your computer and use it in GitHub Desktop.
Using perl to extract elements from regex into an array
use Data::Dumper;
$s = "1-19A";
@a = $s =~ m/(\d+)\-(\d+)([A-Z])?/i;
print Dumper(@a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment