in reply to Re: how to remove a string from end of a line
in thread how to remove a string from end of a line

Rather than using a capture I think it might be simpler, since the OP mentions "end of a line" specifically, to just remove any non-pipe symbols anchored to the end of the string.

$ perl -Mstrict -Mwarnings -E ' my $str = q{RcdA|CON|139|||Kan|13|J|J|607|abc@gmail.com}; $str =~s{[^|]*$}{}; say $str;' RcdA|CON|139|||Kan|13|J|J|607| $

Cheers,

JohnGG