in reply to Split criteria
From perldoc perlre:my $line = q(!A001ST!,!AD,CD!,!1!,!20/05/2004!,!ANDORRA!,!0!,!EUR,USD! +,!6!,!7!,!0!,!AD!,!1!); # only commas followed by "!" split fields my @data = split(/\,\s*(?=!)/, $line); print "Data splitted is as below \n"; print join("==>",@data),"\n";
"(?=pattern)" A zero-width positive look-ahead assertion. For example, "/\w+(?=\t)/" matches a word followed by a tab, without including the tab in $&.
|
|---|