I would like to make use of the string that was matched by the regex in the split code line since the numeric will be changing. Is there a special variable such as $_ (which obviously is not it) that contains the matched value?#!/usr/bin/perl -w use strict; my $longstring="first<!--NEWENTRY889700-->last"; my @entries=split(/<!--NEWENTRY\d\d\d\d\d\d-->/,$longstring); print "$entries[0] $entries[1]\n";
In reply to split/matching/regex question by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |