in reply to Re: Trim Two Characters On Line
in thread Trim Two Characters On Line
$line =~ s/(SUM.*)(..)/$1/This does not seem to meet jalopez453's requirement. The strings 'SUMx' and 'SUM' both contain the substring 'SUM' and so should truncate to 'SU' and 'S' respectively, but do not.
Also, I don't understand how the sequence of operations
comes about. A typo?DB<1> $_ = 'abcSUXcdexx' DB<2> s/(SUM.*)(..)/$1/ DB<3> p abcSUMcde
Give a man a fish: <%-{-{-{-<
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Trim Two Characters On Line
by LanX (Cardinal) on Oct 23, 2020 at 08:07 UTC |