Nick Diel wrote: > 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. > > Thanks, > Nick
If the parens are the factor then you could try something like: if ( /.+\(([^)]+)\).+\(([^)]+)\)/ ) { $My1stVar = $1; # include everything up to the next right ) in $1 after finding a left ( $My2ndVar = $2; # include everything up to the next right ) in $2 after finding a left ( }else { # no hit on var(s), what do you want to do } Wags ;) ********************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. **************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]