To extract boston.terrier out why wouldn't this work?my $pet_list = 'dog:boston.terrier;cat:orange.tabby';
Doesn't the ;?? mean match semi-colon 0 or 1 times and be non-greedy?@{$pets} = $1 if $pet_list =~ /$some_variable\:(.+);??/;
In reply to Pattern Match n00b by USP45
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |