use strict;
my $str = '<![CDATA[
var playerInstance = new artiplayer(\'artimedia-player-0404-1\',{
source: {type: "video/mp4", src: "https://www.lolka.co.il/wp-content/uploads/2018/12/Screen-Shot-2018.jpg"},
poster: "https://www.lolka.co.il/wp-content/uploads/2018/12/Screen-Shot-2018-12-28-at-15.46.29-e1546004840977.png",
autoplay: false,
sitekey: \'0404\',
category: "test src: "varffff1"
});
]]>
[1]: <![CDATA[
var playerInstance = new artiplayer(\'artimedia-player-0404-3\',{
source: {type: "video/mp4", src: "https://www.0404.co.il/wp-content/uploads/2019/01/WhatsApp-Video-2019-01-07-at-08.33.38.mp4"},
poster: "https://www.0404.co.il/wp-content/uploads/2019/01/WhatsApp-Image-2019-01-07-at-08.38.27.jpeg",
autoplay: false,
sitekey: \'0404\',
category: "test"
});
]]>';
my $regex = qr/src: \"[^\>]*\"\}/p;
if ( $str =~ /$regex/ ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html