[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] TPJ One-Liner #39



patrik.grip-jansson@vv.se wrote:
> Edward M. Perry wrote;
> > > I'm quite sure it can be solved, but at the price of code bloat! :-)
> >
> >You can fix that pesky final character with a mere 16 characters of 
> >bloat (~ 40%), and a rewrite:
> >
> >perl -ne'push(@a,/\b[A-Z]\w*/g);END{print join($",@a)}'
> 
> So, finally we have come full circle and are back at the first solution
> from Perl Journal. Well of course the reg exp is improved...

If you want to internationalize (or at least localize) the regexp, can't you do
this?
  /\b\w(?<![\d_])\w*/

I can't test that because my perl isn't recent enough, so how about this?
  /\b(?![\d_])\w+/
Note + instead of *

-- 
	Peter Haworth	pmh@edison.ioppublishing.com
Idiot, n.:  A member of a large and powerful tribe whose influence in
            human affairs has always been dominant and controlling.
	-- Ambrose Bierce, "The Devil's Dictionary"


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe