should meet your requirement.
Bonus: $2 will hold the truncated characters.
Demo in the debugger
DB<1> $_ = 'abcSUMcdexx' DB<2> s/(SUM.*)(..)/$1/ DB<3> p abcSUMcde DB<3> $_ = 'abcSUXcdexx' DB<4> s/(SUM.*)(..)/$1/ DB<5> p abcSUXcdexx DB<5>
Update: typo fixed in DB<1> , thx to AnomalousMonk for spotting.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re: Trim Two Characters On Line
by LanX
in thread Trim Two Characters On Line
by jalopez453
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |