From: Kyle Schmitt Date: 2008-12-02T04:52:11+09:00 Subject: Re: Regular Expressions On Mon, Dec 1, 2008 at 1:51 PM, Kyle Schmitt 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 :)