in reply to Re: How to do it in one line?
in thread How to do it in one line?

Same basic idea, but I shaved a few chars off of it....
# 1 2 3 4 #2345678901234567890123456789012345678901234 perl -pe's/(.)\1(\1*)(?!\1)/$2?$&:"($&)"/ge' file.txt

-Blake

Replies are listed 'Best First'.
Re: Re2: How to do it in one line?
by r (Initiate) on Jul 04, 2002 at 10:22 UTC
    Thanks a lot, although it is not a homejob ;-) Question is if itīs possible using exclusively regex (no ternary operator).

    Explore the unknown,
    know the known.

    -r