perl regex groups
- by Aaron Moodie
I've currenly trying to pull out dates from a file and feed them directly into an array. My regex is working, but I have 6 groups in it, all of which are being added to the array, when I only want the first one.
@dates = (@dates, ($line =~ /((0[1-9]|[12][0-9]|3[01])(\/|\-)(0[1-9]|1[0-2])(\/|\-)([0-9][0-9][0-9][0-9]|[0-9][0-9]))/g ));
is there a simple way to grab the $1 group of a perl regex?
my output is looking like this:
13/04/2009, 13, /, 04, /, 2009, 14-12-09, 14, -, 12, -, 09