---------- Forwarded message ---------- Date: Wed, 16 Jul 2003 18:23:35 -0500 (EST) From: trensett <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: Regular Expression
On Wed, 16 Jul 2003, Janek Schleicher wrote: > 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; what's the exact implication of ".*?"? Why wouldn't just .* in parenthesis work for this case? > > 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] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]