in reply to Using OR () in Regex

You wrote it already: /abc(def|xyz)/ works.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: Using OR () in Regex
by arunhorne (Pilgrim) on May 06, 2002 at 12:13 UTC

    Thats interesting - I was under the impression brackets were used as a memory more than a precedence operator... do they provide precedence in the conventional sense of the word and therefore why does this not work...

    m/(\S=\S)|( =\S)|(\S= )/g

    ... to look for all the occurences of an equals sign that is not got whitespace on either side?

    Thanks.

      I have yet to see your code where that regex "does not work". It works for me.

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;