in reply to how to extract string by possible groupings?
/((.*\.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
... 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)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to extract string by possible groupings?
by davido (Cardinal) on Jun 02, 2014 at 23:16 UTC | |
by AnomalousMonk (Archbishop) on Jun 02, 2014 at 23:43 UTC | |
by LanX (Saint) on Jun 02, 2014 at 23:26 UTC | |
by davido (Cardinal) on Jun 02, 2014 at 23:57 UTC | |
Re^2: how to extract string by possible groupings?
by AnomalousMonk (Archbishop) on Jun 02, 2014 at 23:14 UTC | |
by LanX (Saint) on Jun 02, 2014 at 23:22 UTC | |
Re^2: how to extract string by possible groupings?
by muba (Priest) on Jun 02, 2014 at 18:48 UTC | |
by LanX (Saint) on Jun 02, 2014 at 19:57 UTC |