[26637] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8745 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 8 09:05:29 2005

Date: Thu, 8 Dec 2005 06:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 8 Dec 2005     Volume: 10 Number: 8745

Today's topics:
        ANNOUNCE: Regexp::Common::time <sdn.girths00869@zoemail.net>
    Re: Removing duplicates with RegExp <noreply@gunnar.cc>
    Re: Removing duplicates with RegExp (Anno Siegel)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 08 Dec 2005 06:20:09 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: ANNOUNCE: Regexp::Common::time
Message-Id: <Xns97264B05DD231sdn.comcast@216.196.97.136>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

Greetings, Perl Community.

    I am pleased to post a new module, Regexp::Common::time, to
CPAN.

    This is a plug-in module for Regexp::Common.  It provides
out-of-the-box regular expressions for parsing most common date/time
formats, including most ISO-8601 style date/time strings.  Even
better, it allows you to build arbitrarily complex date/time
patterns from strftime's "%" formats, or from Time::Format's
mnemonic formats.  It is also locale-aware. (thus, it can match
month and day names in the language appropriate for the current
locale). 

    This module is part of a trio of modules for handling conversion
of date data to and from string representations.  Time::Format
makes it easy to convert dates/times into formatted strings;
Regexp::Common::time aids in reading date/time strings; and
Time::Normalize takes the date/time components (from 
Regexp::Common::time, for example), checks them for errors, and
transforms them into a standardized representation so you don't
have to. 

    These modules don't do computations or other date/time
manipulations; there are excellent modules already on CPAN that do
that.  These modules are for formatted I/O of date/time data... in
just about every imagineable manner. 

    Regexp::Common::time is a new module, so of course use it with
caution.  Still, it has a test suite with over 7000 tests in it.
It is reasonably fast, too; the test suite runs in 4 seconds on my
creaky old home computer.  But since it is new and hasn't been
extensively battle-hardened, there may be surprises lurking beneath
the surface.  Bug reports are welcome. 

    I have high hopes for this module.  May it be useful to you.

- -- 
Eric J. Roode
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32) - WinPT 0.7.96rc1

iD8DBQFDmCV4Y96i4h5M0egRAsFqAJ0eFFCM/PlPBpgVhjLitJPaKEQPcQCg+nMG
MXCDiYxeqgfNGQTSJTApODo=
=lUSH
-----END PGP SIGNATURE-----


------------------------------

Date: Thu, 08 Dec 2005 09:58:59 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Removing duplicates with RegExp
Message-Id: <3vqaulF17g0gaU1@individual.net>

Daniel Kaplan wrote:
> Was curious, is there a RegExp to remove duplicates?  Am trying to remove 
> duplicate spaces (when they are together) and replace them with one space.
> 
> So that:
> "This     is    my example of      !"
> 
> Becomes:
> "This is my example of !"

This is more efficient than invoking the regexp engine:

     tr/ //s;

but it's not equivalent to s/\s+/ /g; see "perldoc perlop".

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: 8 Dec 2005 11:00:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Removing duplicates with RegExp
Message-Id: <dn93ov$rss$1@mamenchi.zrz.TU-Berlin.DE>

Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> Daniel Kaplan wrote:
> > Was curious, is there a RegExp to remove duplicates?  Am trying to remove 
> > duplicate spaces (when they are together) and replace them with one space.
> > 
> > So that:
> > "This     is    my example of      !"
> > 
> > Becomes:
> > "This is my example of !"
> 
> This is more efficient than invoking the regexp engine:
> 
>      tr/ //s;
> 
> but it's not equivalent to s/\s+/ /g; see "perldoc perlop".

Because it only deals with blanks and not other white space?

    tr/ \t\n\r\f/ /s;

(untested) should do that.

Anno
-- 
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article.  Click on 
"show options" at the top of the article, then click on the 
"Reply" at the bottom of the article headers.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8745
***************************************


home help back first fref pref prev next nref lref last post