Regex help

Torsten Knorr create-soft at freenet.de
Sat Apr 21 19:13:28 BST 2012


($label, $opcode) = m/^\s*
    (?::(\w+)\s+)?       # label
    ([A-Za-z]+)\s+      # opcode
    (?:([^,\s]+)(?{push(@operands, $^N)}),?\s*)* # operands
    $/x;

Torsten




More information about the london.pm mailing list