🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #1747

Re: consulta php preg_match y tipos de variables

#1747
From: Cristian Gutierrez
Date: Wed, 07 Jun 2006 16:35
39 lines
2290 bytes
Hoy en la ma~nana, Rick oj dijo:
> Cristian Gutierrez dijo:
>> Hoy en la noche, Rick oj dijo:

[...]

>>> <?
>>> $subject = "PHP es el lenguaje de scripting web de moda. Este es una 
>>> prueba
>>> en php";
>>> $pattern = "/php/i";
>>> preg_match($pattern, substr($subject,0),$matches);
>>> print_r($matches);
>>> ?>
>>>
>>> solamente me muestra el que esta con mayusculas es decir la primera
>>> coincidencia
>>
>> Te falta el modificador "g", que calza todas las veces que aparezca la
>> expresion regular en la linea. La cosa quedaria entonces asi: "/php/ig".
>
> gracias bueno tratare de buscar un manual mejor, ya que el de php.net no me 
> indica muchas opciones
> de parametros,

Me retracto. Eso fue una extrapolacion de los modificadores disponibles
en Perl, pero por lo visto no esta en la lista de los soportados por
PHP (ver <http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php>).

El equivalente al modificador `/g' esta disponible en (para variar) otra
funcion, `preg_match_all'
(<http://www.php.net/manual/en/function.preg-match-all.php>).

-- 
Guti
117 documents match your query.  Search Amazon.com for top-selling titles 
about +dwarf +"pubic hair". 

-- AltaVista
Technical Details
Message-ID: <87fyig9b51.fsf@guti.cl>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!nntp-server.pubsub.com!news.nivel5.cl!news.cec.uchile.cl!not-for-mail
References: <e64rlm$9kc$1@news.nivel5.cl> <e6597i$cvb$1@news.nivel5.cl> <87y7w9tzen.fsf@guti.cl> <e66nob$mre$1@news.nivel5.cl>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,5ee13cd680b85cc4
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!nntp-server.pubsub.com!news.nivel5.cl!news.cec.uchile.cl!not-for-mail
From: Cristian Gutierrez <crgutier@dcc.uchile.cl>
Newsgroups: chile.comp.programacion
Subject: Re: consulta php preg_match y tipos de variables
Date: Wed, 07 Jun 2006 12:35:38 -0400
Organization: DCC/Uchile
Lines: 39
Message-ID: <87fyig9b51.fsf@guti.cl>
References: <e64rlm$9kc$1@news.nivel5.cl> <e6597i$cvb$1@news.nivel5.cl>
 <87y7w9tzen.fsf@guti.cl> <e66nob$mre$1@news.nivel5.cl>
NNTP-Posting-Host: vpn-client-022.cec.uchile.cl
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: localhost.localdomain 1149698138 9423 172.17.35.22 (7 Jun 2006 16:35:38 GMT)
X-Complaints-To: news@localhost.localdomain
NNTP-Posting-Date: Wed, 7 Jun 2006 16:35:38 +0000 (UTC)
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
Cancel-Lock: sha1:NLyXKnyEuNVNLR5cnIKoSxKmso4=