Hi, Please look at my code below, here I am trying to capture any strings with any character except the comma. Its a simple code but I am not able to understand what is wrong with the regex :(
my $regex = qr/(?:[\S(^,)]+)/; my $var = "abc,d"; $flag=1 if $var =~ /\G ($regex) /gcx; print "matches \n" if $flag==1; print "not matches \n" if $flag==0;
Here the result I want is: "not matches" but its "matches" everytime.
In reply to Regex to capture every readable character except COMMA by nehavin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |