perl - Get substring after specific pattern, split or look behind? -
how can dates after sp^
in:
89564;02/03/2005;;mt;m^08/17/75^f^12/28/2004^sp^07/22/57 89565;02/03/2005;duo;mg;m^07/24/50^f^05/11/82^f^03/01/92^f^04/20/1986^sp^09/03/51
not sure if can use lookbehind since don't want delimiter, dates. can split , dates after sp^
?
sp^
in different positions in dataset, not last substring.
this enough examples:
print "$1\n" if $s =~ /sp\^(.*)$/;
but if want specific date format:
print "$1\n" if $s =~ m!sp\^(\d\d/\d\d/\d\d)!;
Comments
Post a Comment