#!/usr/bin/perl -w

use strict;

my $string = q(<Form action = 'hellocgi.pl?kiwpg=zgu.2/gfbuynpby//:cggu'
color='ssss'>);
my $string2 = 'aaaaa xxbxxx bbbbb aaaaa xxaxx bbbbb';

print "$1\n" if $string =~ m!kiwpg=(.*?)'!;       #'   



my @array = $string2 =~ m/aaaaa(.*?)bbbbb/g;

print "@array\n";

__END__

. match one of anything
* match what is before it 0 or more times
? make matck non gready

/Stefan

Francesco del Vecchio wrote:
> 
> Hi to all,
> 
> Im new to the list and to the Perl too...and I've some problems with pattern 
> matching.
> 
> from a string of this kind:
> 
> <Form action = 'hellocgi.pl?kiwpg=zgu.2/gfbuynpby//:cggu' color='ssss'>
> 
> that can have none or more parameter (as color) I would like to estract th 'kiwpg' 
> value.
> 
> How can I do?
> =========================
> another problem
> 
> If I have a string as the following:
> 
> aaaaa xxxxxx bbbbb aaaaa xxxxx bbbbb
> 
> and I try a m/aaaaa(.*)bbbbb/g
> $1 = xxxxxx bbbbb aaaaa xxxxx
> 
> what have I to do to obtain two matches each of one give me
> 
> $1 = xxxxx
> 
> ?
> 
> Thanks in advance
> Francesco
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to