yitzle wrote:
> $strings = qw/Formatting_l_cs.cat Formatting_l_da.cat
> Formatting_l_de.cat Formatting_l_zh-tw.cat/;
You are assigning a list to a scalar so that is equivalent to:
$strings = 'Formatting_l_zh-tw.cat';
> my $partStrings = ( $strings =~ /_.*?\./ )[0]; # Minimun from _ to .
The exp
Nishi wrote:
> Hi:
Hello,
> I have a strings such as
> Formatting_l_cs.cat
> Formatting_l_da.cat
> Formatting_l_de.cat
> Formatting_l_zh-tw.cat
> I need to extract the substring before the "." and after the last occurence
> of "_" ie in the above cases, it would return "cs" or zh-tw" etc.
>
> Ho
Nishi wrote:
Hi:
I have a strings such as
Formatting_l_cs.cat
Formatting_l_da.cat
Formatting_l_de.cat
Formatting_l_zh-tw.cat
I need to extract the substring before the "." and after the last occurence
of "_" ie in the above cases, it would return "cs" or zh-tw" etc.
How can I achieve this?
HT
$strings = qw/Formatting_l_cs.cat Formatting_l_da.cat
Formatting_l_de.cat Formatting_l_zh-tw.cat/;
my $partStrings = ( $strings =~ /_.*?\./ )[0]; # Minimun from _ to .
This code is untested. The RegEx should work but the rest... not sure.
It would work in a loop, though.
Can someone explain why