http://qs321.pair.com?node_id=1088268


in reply to how to extract string by possible groupings?

I think you are confused about how groupings work

/((.*\.c\s)|(.*\.h\s)|(.*\.cpp\s))|(\s+(.*)\%\s+(of+)\s+\d+\s)|(\bNone +\b)/g #01 2 3 4 5 6 7

each opening bracket starts a grouping. Groupings that don't match will be undef !

You can use extended regex (?:PATTERN) for clustering but not grouping to skip an index

update

... or even avoid (...) where you don't need any clustering at all (like in your or-branches).

Cheers Rolf

(addicted to the Perl Programming Language)