Can you assume it is always the last thing on the line?
use strict; use warnings; my @tests=('For the fiscal year ended December 31, 2015', 'For the fiscal year ending December 31, 2015', 'For the fiscal year ending December 31, 2015'); for my $line (@tests) { my @parts=split(' ',$line); print $parts[-3].' '.$parts[-2].' '.$parts[-1]."\n"; }
In reply to Re: REGEX for date
by huck
in thread REGEX for date
by wrkrbeee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |