in reply to Re: Regex question
in thread Regex question

Not only ugly, it doesn't match the OP's spec. It matches everything from the first non-special character through the last comma. Try it with
$foo = 'var-a numeric (10,0) = NULL, var-b char (10) = NULL, var-c dum +my (1, 5)';
Since you're specifying a capture group, you're probably better trying for a m//g style capture, rather than using split. Like so:
my $str = 'var-a numeric (10,0) = NULL, var-b char (10) = NULL, var-c +dummy (1, 5)'; my @bits = $str =~ /(?:^|,) # Match starting at beginning of string or a comma ( # Capture (?: # group of [^(,] # non-parens | # or \(.*?\) # open-paren to close-paren )* # as many times as possible )/gx; print ">$_<\n" for @bits;

Caution: Contents may have been coded under pressure.