Nick Diel wrote at Tue, 15 Jul 2003 11:12:18 -0600:

> I am having a hard time getting a regular expression to work the way i want
> it to.  Take the following text: bla bla bla (la la) bla bla (di da)
> 
> I want to extract the la la to one variable  and di da to antoher variable.
> What I have tried so far is using match variables, but so far I am only able
> to match either just la la or la la) bla bla (di da.

It would be better if you show us not only a description of your code, but
your real code.

The next will work:
my @variable = $string =~ /\((.*?)\)/g;

Now $variable[0] contains 'la la' and
    $variable[1]          ' di da'.


Greetings,
Janek



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

Reply via email to