http://www.perlmonks.org?node_id=24796


in reply to Regex OR'ing

Well, I'm still not clear, but this might work:

$var =~ /regex(catch_this)|$/

I don't see why you need to match nothing at the start of the string so matching nothing only at the end of the string might fix your problem. You can use \Z instead of $ is you are paranoid about trailing newlines and don't care about not working on old versions of Perl.

Replies are listed 'Best First'.
RE: Re: Regex OR'ing
by spectre (Scribe) on Jul 28, 2000 at 20:47 UTC
    This is what I ended up doing - It works beautifully.
    Thanks for the suggestion

    Regards,
    spectre