in reply to help in understanding odd regex match

There are a few things that are a bit screwey with this: There's a question about your second s/// though: Currently, you look for 10 or more pairs of one alphanumeric character and one non-special character. The reason why you have ?.*2 in your actual string is because you have an ODD number of characters. Your "pair" semantics leave one behind, therefore. We'll need more info before we can decide what you actually want here.

HTH.



Code is (almost) always untested.
http://www.justicepoetic.net/

Replies are listed 'Best First'.
Re: Re: help in understanding odd regex match
by jaco (Pilgrim) on Feb 20, 2004 at 07:08 UTC
    Thank you,

    I see the mistake i'm making now in the second s///. all better.

    Also i was unaware that using $& was any worse the $1,$2.
    Thanks for pointing that out as well.

    I do appreciate the help.

      $& slows down every regular expression in your program where $1 and friends just slow down those regular expressions that use them. Same goes for $` and $'. This is documented (albeit sparsely) in perlvar