in reply to Re: Regex to take an ip address before a comma
in thread Regex to take an ip address before a comma

Assigns everything up to the first comma to $first
$ perl -wle 'my $str = "a, b,"; my ($first) = $str =~ /(.*),/; print $ +first' a, b
Up to the last comma, actually. If you want "up to the first comma" either use ([^,]*), or (.*?),