[25965] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8184 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 18 06:05:31 2005

Date: Sat, 18 Jun 2005 03:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 18 Jun 2005     Volume: 10 Number: 8184

Today's topics:
    Re: How to kill a forked child process... a@a.com
        Regex with a varrying number of captures  <jgottman@carolina.rr.com>
    Re: Regex with a varrying number of captures  <jurgenex@hotmail.com>
    Re: Regex with a varrying number of captures <nobull@mail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 18 Jun 2005 09:47:35 GMT
From: a@a.com
Subject: Re: How to kill a forked child process...
Message-Id: <a6r7b1t83a5vb8mls9tnagrg374vn2ah5n@4ax.com>



This is a suggestion not an answer...

Look at "Parallel::Forkmanager" perl mod..

I was trying to do a similiar task and gave up
(the process of following threads was mind binding) ...

some1 on this group mentioned the mod and
i've been quite happy since...


Joe


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

Date: Sat, 18 Jun 2005 02:49:19 GMT
From: "Joe Gottman" <jgottman@carolina.rr.com>
Subject: Regex with a varrying number of captures 
Message-Id: <PYLse.16410$1u3.1423406@twister.southeast.rr.com>


I am parsing a file with several lines of the form
    keyword : value1 value2 ... valueN

What is the easiest way for me to write a regex that will capture all of the 
values?  my first pass was
     /^ \s* keyword \s* : (?: \s* (\w+)  \b)+/x

but this only captures the last value.

Joe Gottman 




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

Date: Sat, 18 Jun 2005 03:12:57 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Regex with a varrying number of captures 
Message-Id: <ZiMse.30655$yw4.17428@trnddc09>

Joe Gottman wrote:
> I am parsing a file with several lines of the form
>    keyword : value1 value2 ... valueN
>
> What is the easiest way for me to write a regex that will capture all
> of the values?

Well, why do you want to use a regexp? A simple
    my ($keyword, undef, @values) = split / /,$line;
should do the job much easier and faster.

jue 




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

Date: Sat, 18 Jun 2005 08:41:22 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Regex with a varrying number of captures
Message-Id: <d90j73$p93$1@redhat2.bham.ac.uk>



Joe Gottman wrote:

> I am parsing a file with several lines of the form
>     keyword : value1 value2 ... valueN
> 
> What is the easiest way for me to write a regex that will capture all of the 
> values?  my first pass was
>      /^ \s* keyword \s* : (?: \s* (\w+)  \b)+/x

The easiest way is not to try.  Do it in two steps.

It can be done in one step using (?{}) but that's way more complex.

In this specific case there are alternative ways if you are willing to 
presume (or have already verified) that the input conforms.

Eg.

   /(\w+)/g; # Then discard the first



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

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 8184
***************************************


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