Hello list,
I have a problem that I've solved with some logic and a few lines of
code but I'm sure that there is a good regexp that can do the job. So I
ask the regexp gurus of this list whether they have a solution.
Let's start with this :
John Douglas Porter a écrit :
Alexandre Jousset [EMAIL PROTECTED] wrote:
Any clue ? I'm sure this is an old problem...
Yes - See The Perl Cookbook, recipe 2.17.
Indeed... :-/
Sorry for the bothering...
Thanks also to Artur Penttinen for the answer in my inbox :
* Alexandre Jousset [EMAIL PROTECTED] [2006-08-28 18:15]:
For the moment I have a (too) complicated sub spacify and I would
like to simplify it to a regexp.
It doesn’t have to be complicated, even without a regexp.
scalar reverse join ' ', unpack '(A3)*', reverse $num;
Regards,
--
Here's the golfed version :) ( borrowed from Rick Klements solution to
the TPR(0,5b) contest ).
s/\B(?=(...)*$)/ /g
Terje K
p.s. This works on integers only.
-Opprinnelig melding-
Fra: Alexandre Jousset [mailto:[EMAIL PROTECTED]
Sendt: 28. august 2006 18:14
Til: Fun with Perl
Emne: