$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 everyone's so into using qw/  /  opposed to
quotes and commas?

On 4/19/07, Nishi <[EMAIL PROTECTED]> 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?

Thanks!


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to