in reply to Rewriting Three Regexes as One

OK, I found the answer myself. Just in case anyone else ever has the same problem... its because I included brackets!! The following will work fine. I felt they improved readability, but this is no good at the expense of it not working ;D

m/\S=\S| =\S|\S= /g

Sorry people.

Replies are listed 'Best First'.
Re: Re: Rewriting Three Regexes as One
by Sidhekin (Priest) on May 05, 2002 at 02:58 UTC
    m/\S=\S| =\S|\S= /g

    Since you are concerned about readability, here is what I would prefer ... not that everyone thinks like me, but at least you have one more option :-)

    # Bad: m/[\S ]=[\S ]/g m/(?!: = ).=./gs

    Update:I should not post this early ... I misread the specs. Without doing capturing braces (and you don't want that, I gather), I can do no better than your version.

    Update 2:Added the negative lookahead version.

    The Sidhekin
    print "Just another Perl ${\(trickster and hacker)},"