[EMAIL PROTECTED] wrote:
If you just want to remove the last occuring '-' character, then the
following would work.
s/(.*)-(.*)/$1$2/;
Well, huh. That does work. Though it reminds me only of how little I
understand why.
Thanks, you've made it look easy.
His regex works because perl uses greedy
>
>If you just want to remove the last occuring '-' character, then the
>following would work.
>
>s/(.*)-(.*)/$1$2/;
Well, huh. That does work. Though it reminds me only of how little I
understand why.
Thanks, you've made it look easy.
** CONFIDENTIALITY NOTICE **
NOTICE: This e-m
[EMAIL PROTECTED] wrote:
Hi All,
Hello,
The code below does what I want to do, but it takes 3 lines and a temporary
array (yuck).
It does? Could you please explain what exactly you want to do? Just going
by
your subject line, this will work (assuming $_ contains the data.)
s/(.*)-/$1/;
I can't c
[EMAIL PROTECTED] wrote:
>> [EMAIL PROTECTED] wrote:
>>
>>> Hi All,
>>>
>>> The code below does what I want to do, but it takes 3 lines and a
>>> temporary array (yuck). I can't come up with a one line regex
>>> substitution. Anyone got one?
>>>
>>> my $tmp = reverse split //, $_;
>>> $tmp =~
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Hi All,
The code below does what I want to do, but it takes 3 lines and a
temporary
array (yuck). I can't come up with a one line regex substitution.
Anyone
got one?
my $tmp = reverse split //, $_;
$tmp =~ s/-//;
$_ = rever
>[EMAIL PROTECTED] wrote:
>
>>Hi All,
>>
>>The code below does what I want to do, but it takes 3 lines and a
temporary
>>array (yuck). I can't come up with a one line regex substitution.
Anyone
>>got one?
>>
>>my $tmp = reverse split //, $_;
>>$tmp =~ s/-//;
>>$_ = reverse split //, $tmp;
>
>can
Hi All,
The code below does what I want to do, but it takes 3 lines and a temporary
array (yuck). I can't come up with a one line regex substitution. Anyone
got one?
my $tmp = reverse split //, $_;
$tmp =~ s/-//;
$_ = reverse split //, $tmp;
TIA,
Peter
** CONFIDENTIALITY NOTICE **
N