On Mon, 2001-12-17 at 15:16, Jeff 'japhy' Pinyan wrote:
> There are two approaches.  One of them is the computer science way, and
> the other is the diehard-regex-hacker way.  I'll show you both (the regex
> way requires Perl 5.6, by the way).

I didn't even think of using regexps.  And you called _me_ a regexp
master yesterday.  Sigh.

I wrote:
> > I'll bow down to anyone who can make a one-liner of it, naturally.

> It reduced a sizeable algorithm down to one simple regex: 
>   s/\b(\d+)(?:,((??{1+$+})\n))+/$1-$+/g;

<fx: Chris bows deeply and respectfully>

- ~C.
-- 
$a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
         "In the beginning there was nothing, which exploded."          


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to