My interpretation of the OP is that the OPer is trying to capture entire strings that contain no commas. If one is trying to extract sub-string sequences that contain no commas, split seems like a good way to go. BTW: For the latter purpose, a regex without explicit capture or look-ahead can also be used:
>perl -wMstrict -le "my $regex = qr/ [^,]+ /x; my $var = 'abcd,ef,,ghijkl,mnop'; printf qq{'$_' } for $var =~ /$regex/g; " 'abcd' 'ef' 'ghijkl' 'mnop'
(Although as Anonymonk has pointed out below, the latter interpretation puts you dangerously close to territory dominated by Text::CSV and its ilk.)
In reply to Re^4: Regex to capture every readable character except COMMA
by AnomalousMonk
in thread Regex to capture every readable character except COMMA
by nehavin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |