Can some one please explain me the following expression
$input =~ m/\G".*?"(,|$)/gc || $input =~ m/\G[^,]*(,|$)/gc || die;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are two regexes here. The first is:
The second will be matched if the first one fails:
My guess is the two regexes are designed to match something which can either be quoted or not quoted, and may be followed by some more items after a comma.
(The
cmodifier means to keep the current position if the matching fails, so the\Ganchor won’t change in the second attempt to match if the first one fails. Thegmodifier sets the position for\Gfor the next match – among other things.)