On Mon, Dec 1, 2008 at 1:51 PM, Kyle Schmitt <kyleaschmitt / gmail.com> wrote:
> I just wanted to mention another way of combining regexes that may
> help you stay sane: union.
>
> #You write each regex nice and simple like..
> startswith=/~23430000/
> codered=/CodeRed/
>
> #Then combine them to a complex one
> combined_regex=Regexp.union(startswith,codered)
>
> When you've got to build up some large regular expressions, this can
> be a godsend, especially when revisiting code you haven't looked at in
> awhile.
>
> --Kyle

Scratch that, not thinking clearly!  This is to match startswith OR
codered, not necessarily both.

Still, I maintain that this is a way of staying sane with complex regexes :)