[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] regex gurus




Looking at examples, not getting it done.

Any regex gurus out there that can give me a tip on taking a string and splitting into groups based on what is between '( )'

So I can take condstring, split it into an array by whats grouped in (), then take each element and split out the rest of the () groups.
i.e.

my $condstring="include_1 (f7 ne \'ce\' and f10 ne \'r\' and f1 ne \'ce\' and f8 ne \'lg\' and f8 ne \'li\' and f8 ne \'lj\' and f8 ne \'lr\' and f8 ne \'lu\' and f8 ne \'lv\' and f8 ne \'tl\' and f8 ne \'ta\' and(f4 eq \'e\' or f4 eq \'g\' or f4 eq \'w\')) ";

  @condarr = split /(\).*\))/, $condstring;


--
Jay Swackhamer
Reboot The User
402-933-6449
http://www.reboottheuser.com
http://www.cafepress.com/rtu
http://stores.ebay.com/RebootTheUser
http://www.hotr.com