in reply to Re^2: Cleaner regex conversion
in thread Cleaner regex conversion

Well, the official perl book is 'Programming Perl' (Wall,Christiansen,Schwartz) and it naturally has this and practically everything else covered.

Also check out the manual pages, in this case perlre (also available online: http://perldoc.perl.org/perlre.html ).

Replies are listed 'Best First'.
Re^4: Cleaner regex conversion
by Anonymous Monk on Jul 05, 2008 at 17:19 UTC
    Hmm. I have a copy of that book but it is several years old. I also checked the perlre and didn't find reference to the use of 'x' in the replace portion of the expression:

    s/()/"." x ()/ge

    Can you give me a more specific reference? I've looked but do not see it.

      Check out perldoc perlop - Multiplicative Operators

      update: sorry; nevermind, I missed your next entry...

Re^4: Cleaner regex conversion
by Anonymous Monk on Jul 05, 2008 at 17:26 UTC
    Thanks. Nevermind the last comment. I found it under Multiplicative Operators in the web link you provided.
      Ah, I see. You thought the x operator was a special regex. But really the interesting thing is the e at the end of the regex, with that you can put anything inside the regex, the substitution pattern is like a block or subroutine.