🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #744

Re: Expresion Regular II

#744
From: Pintamono
Date: Fri, 19 Oct 2007 20:20
68 lines
2443 bytes
Gracias pero no me sirvio...



+mArkO+ wrote:


> no soy muy entendido en el tema, pero podria ser:

> ([SNsn])([a-zA-Z0-9 ]+)\s([a-zA-Z0-9 ]*)(\r\n)*([\s\S]*)

> + =>1 � mas veces
> * =>o � mas veces


> "Pintamono" <pintamono@NoMandeWeas.kk> escribi� en el mensaje 
> news:73a2d0f1f74ebfdede4c3cc14a267ce5$1@usenet.no-ip.com...
>> Tengo la siguiente expresion regular:
>>
>> ([SNsn])([a-zA-Z0-9 ]+)\s([a-zA-Z0-9 ]+)\r\n([\s\S]*)
>>
>> Esta expresion me acepta texto del tipo
>>
>> |S150 RTF3434
>> 1 23 4 5 6 7 8 9 0
>>
>> Y
>> |S150   RTF3434
>> 1 23 4 5 6 7 8 9 0
>>
>> Pero no me deja obviar el segundo campo de la primera linea, es decir...
>>
>> |S150
>> 1 23 4 5 6 7 8 9 0
>>
>> Esto no pasa.
>>
>> Considerando que el * es el comodin
>>
>> Probe con
>>
>> ([SNsn])([a-zA-Z0-9 ]+)\s*([a-zA-Z0-9 ]+)\r\n([\s\S]*)
>> ([SNsn])([a-zA-Z0-9 ]+)\s(*[a-zA-Z0-9 ]+)\r\n([\s\S]*)
>> ([SNsn])([a-zA-Z0-9 ]+)\s([a-zA-Z0-9 ]*+)\r\n([\s\S]*)
>>
>> Sin obtener resultados positivos...
>>
>>
>> Como puedo dejar la expresion para que el segundo campo aparezca 0 o 1 vez
>> solamente?
>>
>> Gracias!!!
>>
>> Nota: Lo que necesito es ingresar texto del tipo
>>
>> |S150 RTF1
>> 1 avisos 23 4 5 6 7 8 9 0
>> |S151 RtF2
>> 2 avisos 23 4 5 6 7 8 9 0
>> |S505  rtf3
>> 3 avisos 23 4 5 6 7 8 9 0
>> |S460
>> 4 avisos 23 4 5 6 7 8 9 0
>> |S200  ftr4
>> 5 avisos 23 4 5 6 7 8 9 0
>> |S800  ppp5
>> 6 avisos 23 4 5 6 7 8 9 0
>>
Technical Details
Message-ID: <dc126c20d349aa26aaf5b790c09a069f$1@usenet.no-ip.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!not-for-mail
References: <73a2d0f1f74ebfdede4c3cc14a267ce5$1@usenet.no-ip.com> <ffakrm$vdd$1@news.nivel5.cl>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,8b91cd4b54ad36b9
X-Google-Attributes: gid1593cb,public,usenet
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!not-for-mail
From: pintamono@NoMandeWeas.kk (Pintamono)
Newsgroups: chile.comp.programacion
Subject: Re: Expresion Regular II
Date: Fri, 19 Oct 2007 16:20:48 -0400
Organization: Usenet Chile.* http://usenet.no-ip.com
Lines: 70
Message-ID: <dc126c20d349aa26aaf5b790c09a069f$1@usenet.no-ip.com>
References: <73a2d0f1f74ebfdede4c3cc14a267ce5$1@usenet.no-ip.com> <ffakrm$vdd$1@news.nivel5.cl>
NNTP-Posting-Host: pc-146-86-104-200.cm.vtr.net
Mime-Version: 1.0
X-Trace: news.nivel5.cl 1192821642 980 200.104.86.146 (19 Oct 2007 19:20:42 GMT)
X-Complaints-To: news@news.nivel5.cl
NNTP-Posting-Date: Fri, 19 Oct 2007 19:20:42 +0000 (UTC)
User-Agent: NewsPortal/0.3X RCL MOD
X-Abuse: robertocl@gmail.com
X-HTTP-Posting-Host: 200.27.140.110