# match everything at once @everything = /^\s*(\w+)\s*=\s*(\w+)(\s*,\s*\w+)?(\s*,\s*\w+)?(\s*,\s* +\w+)?$/
# match the required part /^\s*(\w+)\s*=\s*(\w+)/gc; ($keyword, $value) = ($1,$2); # match the optional part @optional = /\G\s*,\s*(\w+)/g;
In reply to Re: Matching a keyword, value and optional comma delimited values
by BooK
in thread Matching a keyword, value and optional comma delimited values
by brainpan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |