downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Clases carácter> <Anclas
[edit] Last updated: Fri, 25 May 2012

view this page in

Punto

Fuera de una clase carácter, un punto en el patrón coincide con un carácter en el sujeto, incluyendo un carácter no imprimible, pero no (por defecto) con una nueva línea. Si la opción PCRE_DOTALL está establecida, entonces los puntos coinciden con nuevas líneas tambíen. El manejo del punto es totalmente independiente del manejo de circunflejo y dólar, la única relación existente es que ambos implican caracteres de nueva línea. El punto no tiene un significado especial en una clase carácter.

\C se puede usar para comparar un único byte. Tiene sentido en modo UTF-8 donde el punto coincide con el carácter entero, el cual puede consistir en múltiples bytes.



add a note add a note User Contributed Notes Punto
Anonymous 02-Feb-2011 03:46
Consider,

        preg_match_all("/<img.*>/", $htmlfile, $match);

Since PCRE_DOTALL is not used, this pattern is expected to NOT make matches across multiple lines.  However, in somecases it can, depending on the PCRE default settings and your data ($htmlfile).  The problem is that some are set to recognize NEWLINES differently.
To fix this use,

        preg_match_all("/(*ANY)<img.*>/", $htmlfile, $match);

Now, any character that could possibly be seen as a newline will be interpreted as a newline by the PCRE.
NOTE: This pattern has been available since PCRE version 7.3

 
show source | credits | stats | sitemap | contact | advertising | mirror sites