🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.perl.misc
Article #326

Re: How to search ******

#326
From: Even Holen
Date: Thu, 17 Jul 1997 00:00
30 lines
1495 bytes
In article <33CAFAC4.2013B7C3@csc.albany.edu>, Chao Shao-ju wrote:
>I tried to search a line that contains more than one star (*)  , using:
>
>if ($line =~ /\*\*/)
>{
>................
>}
>
>But it does not work. Could anyone......thanks.

I think you question is vague, therefore I would like to summarize some
of the answers. I just gives the regexp and a short explanation of
it.

 \*\*   Matches two  *'s
 \*+    Matches one or more *'s
 \*\*   Matches two or more *'s... 
 \*{2,} Matches 2 to unlimited number of stars
 \**    Matches zero or any numbers of *!

All this regexps matches * which comes one after another...

Please do read the documentation of regexps once again (man perlre).
Specially the section on quantifiers!

Regards,
Even Holen
-- 
<><   Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/   :-)
Technical Details
Message-ID: <slrn5ssfbk.qav.evenh@ra.pvv.ntnu.no>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <33CAFAC4.2013B7C3@csc.albany.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1133f4,b92671e9260cc62
X-Google-Attributes: gid1133f4,public
X-Google-Thread: fa0ae,b92671e9260cc62
X-Google-Attributes: gidfa0ae,public
X-Google-Thread: 112333,b92671e9260cc62
X-Google-Attributes: gid112333,public
From: evenh@ra.pvv.ntnu.no (Even Holen)
Subject: Re: How to search ******
Date: 1997/07/17
Message-ID: <slrn5ssfbk.qav.evenh@ra.pvv.ntnu.no>
X-Deja-AN: 257437395
References: <33CAFAC4.2013B7C3@csc.albany.edu>
Organization: The Norwegian University of Science and Technology
Newsgroups: comp.lang.perl.misc,de.comp.lang.perl,fr.comp.lang.perl