in reply to Re: Converting percentage into number
in thread Converting percentage into number

I'm all for using alternative regular expression delimiters from the slash (/) (especially when matching paths). I do think the pipe symbol (|) is potentially confusing though as, at first glance, my eye sees the alternation metacharacter, not a delimiter. Perhaps it's just me.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^3: Converting percentage into number
by GrandFather (Saint) on Jan 10, 2007 at 19:43 UTC

    It's just you. :-p

    I moderately often use alternative delimiters, and when I do I very often choose the pipe symbol - it stands out nicely in the line noise that regexen generally devolve into (even when using /x). Alternatively I use ! for similar reasons, but generally only if I anticipate requiring alternation in the regex.

    And no, I've not been bitten during maintenance by that choice. ;)


    DWIM is Perl's answer to Gödel
      The pipe symbol is not such a problem with m|some pattern| as the pipes are at either end but when substituting like s|old|new| it's the one in middle that causes the double-take. Like you I've not been bitten by it but it does cause me that moment of hesitation.

      I used to use pipe symbols a lot but I find that I am wearing out the curly brace keys as I tend towards m{...} and s{...}{...} these days. It might have something to do with my addiction to quoting constructs. :)

      Cheers,

      JohnGG