Article View: chile.comp.programacion
Article #745Re: Expresion Regular II
From: +mArkO+
Date: Fri, 19 Oct 2007 19:30
Date: Fri, 19 Oct 2007 19:30
77 lines
2812 bytes
2812 bytes
no entendi muy bien tu ejemplo, podrias aclararlo mas cuales son las cadenas que deseas validar "Pintamono" <pintamono@NoMandeWeas.kk> escribi� en el mensaje news:dc126c20d349aa26aaf5b790c09a069f$1@usenet.no-ip.com... > 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:
<ffb0ld$11a$1@news.nivel5.cl>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!not-for-mailReferences:
<73a2d0f1f74ebfdede4c3cc14a267ce5$1@usenet.no-ip.com> <ffakrm$vdd$1@news.nivel5.cl> <dc126c20d349aa26aaf5b790c09a069f$1@usenet.no-ip.com>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: "+mArkO+" <kitim@porta.com> Newsgroups: chile.comp.programacion Subject: Re: Expresion Regular II Date: Fri, 19 Oct 2007 16:30:55 -0300 Organization: Varios Lines: 79 Message-ID: <ffb0ld$11a$1@news.nivel5.cl> References: <73a2d0f1f74ebfdede4c3cc14a267ce5$1@usenet.no-ip.com> <ffakrm$vdd$1@news.nivel5.cl> <dc126c20d349aa26aaf5b790c09a069f$1@usenet.no-ip.com> NNTP-Posting-Host: pc-65-210-30-200.cm.vtr.net X-Trace: news.nivel5.cl 1192822253 1066 200.30.210.65 (19 Oct 2007 19:30:53 GMT) X-Complaints-To: news@news.nivel5.cl NNTP-Posting-Date: Fri, 19 Oct 2007 19:30:53 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Original