in reply to Pattern matching and deriving the data between the "(double quotes) in HTML tag

#!/usr/bin/perl # http://perlmonks.org/?node_id=1177192 use strict; use warnings; my $timeLimit = '<timeLimit endTime="2016-12-28T23:59:59" startTime="2 +016-09-30T00:00:00"></timeLimi +t>'; $timeLimit =~ m/startTime="(.*?)"/; my $startTime = $1; chomp($timeLimit); my $endTime; if ($timeLimit =~ m/endTime/) { $timeLimit =~ m/endTime="(.*?)"/; $endTime = $1; chomp($endTime); } print "[$startTime],[$endTime]\n";
  • Comment on Re: Pattern matching and deriving the data between the "(double quotes) in HTML tag
  • Download Code