From: Daniel Berger Date: 2002-09-25T00:56:55+09:00 Subject: Regular expression object question Hi all, Is there a way to add a new regex to an existing regular expression object? In other words, say I start with a pattern I want to match: re = /xyz/ But later, I decide that I want to also match "abc". As it stands now, I have to create a new regex object for that. Thus: re2 = /abc/ This could go on indefinitely, so simply doing this could quickly become cumbersome: if re.match(string) || re2.match(string)... Thus, what I would like is a way to "push" a new regex onto an old one (i.e. add an "and" or "or"). example: re = /xyz/ re.push("|abc") -> re is now /xyz|abc/ Thoughts? Should I just create my own subclass that does this and shut up? Regards, Dan