[ Kendall P. Bullen writes: ]
>
> On Mon, 5 May 1997, Peter Bostrom wrote:
>
> > #substitute ends with 0-9 and = to nothing, and vice versa
> > $_=~s/=[0-9][0-9]$//;
> > $_=~s/=[0-9]$//;
> > $_=~s/=$//;
>
> So, perhaps this would work:
>
> s/=\d?\d?$//;
>
> That should replace '=' followed by 0-2 digits, at the end of a line,
> with nothing, using one substitution instead of three.
Better, but those are hex numbers, not decimal (space == 20 base 16).
s/=[0-9a-f]?[0-9a-f]?$//i;
--
Dave Wolfe
Follow-Ups:
References:
|
|