in reply to Re^2: To Match the text
in thread To Match the text
Your regex has a few problems:
If you just want to remove the initial part, that's a simpler job:
If you also want the remainder to be broken into separate pieces, use split:$var = "sclerosing 1954, 5–7, 54, 59f-60d, 90, 114"; $var =~ s/^\S+\s+\d+,\s*//; # remove first word and digit string
In fact, split by itself could do both things at once:my @pieces = split /,\s*/, $var;
(updated to fix last snippet)$var = "sclerosing 1954, 5–7, 54, 59f-60d, 90, 114"; my ( $junk, @pieces ) = split /,\s*/, $var;
|
|---|