I assume your immediate problem is that you want to group without capturing. Use the non-capturing group brackets:
/(?:some|stuff)(?:more|stuff).../
I note in your second example however that you may be intending to use regexen for processing HTML. As noted many times before, life is too short to reinvent that particular wheel - there are far too many subtle edge cases and you will get bit! Much better to use tools such as HTML::TreeBuilder or, if you are dealing with XHTML, XML::Twig.
In reply to Re: Grouping regular expressions
by GrandFather
in thread Grouping regular expressions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |