[33063] in Perl-Users-Digest
Perl-Users Digest, Issue: 4339 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 31 09:09:18 2014
Date: Wed, 31 Dec 2014 06:09:03 -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 Wed, 31 Dec 2014 Volume: 11 Number: 4339
Today's topics:
Re: fields separation <cairukai@huawei.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 30 Dec 2014 19:57:03 -0800 (PST)
From: =?UTF-8?B?6JSh5rGd5Yev?= <cairukai@huawei.com>
Subject: Re: fields separation
Message-Id: <43833899-29b8-44bf-8810-7c2c1bbe138e@googlegroups.com>
> > $buff=~s/<(\s*\n*\s*){1,}\*(\s*\n*\s*){1,}>/<*>/g;
>
> This obviously won't work with separators other than <*>. Further, in a regex
>
> \s*\n*\s*
>
> only the first \s* will ever match anything because \s matches \n,
>
> [rw@doppelsaurus]~#perl -e '$a = " \n "; $a =~ /(\s*)(\n*)(\s*)/;
> printf("|%s|, |%s|, |%s|\n", $1, $2, $3);'
> |
> |, ||, ||
Hi Rainer, i do not think it's the important thing, matching the \n with \n or with \s. i just need match the whole pattern ant kill them.
And from the initial example, i can replace all of the \n , cause some of them is in the field, not between the separator. If we can ignore all the \n, it is a walk in the park.
And thank u for ur suggestion of sysread, i will try it.
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 V11 Issue 4339
***************************************