By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

PCRE question

P: n/a
Hello,

It was my understanding that when the PCRE module was loaded in php
that constants would be available that were built in to that module.
For example, I need to use some flags with my regular expression, but
they don't seem to be loaded. Here's an example:

var_dump(PCRE_MULTILINE);
var_dump(PCRE_DOTALL);
var_dump(PCRE_MULTILINE | PCRE_DOTALL);

the lines above produce this output

string(14) "PCRE_MULTILINE"
string(11) "PCRE_DOTALL"
string(14) "PCRE_M_\UMLINE"

Shouldn't those be long values rather than string values?

Could there be a configuration problem with my WAMP test environment?

Thanks,
Daniel
Oct 22 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
*** Daniel escribió/wrote (Wed, 22 Oct 2008 12:10:30 -0700 (PDT)):
It was my understanding that when the PCRE module was loaded in php
that constants would be available that were built in to that module.
For example, I need to use some flags with my regular expression, but
they don't seem to be loaded. Here's an example:

var_dump(PCRE_MULTILINE);
var_dump(PCRE_DOTALL);
var_dump(PCRE_MULTILINE | PCRE_DOTALL);

the lines above produce this output

string(14) "PCRE_MULTILINE"
string(11) "PCRE_DOTALL"
string(14) "PCRE_M_\UMLINE"

Shouldn't those be long values rather than string values?

Could there be a configuration problem with my WAMP test environment?
Yes, it seems you haven't enabled the error reporting. Find your php.ini
file and set these values:

display_errors = On
error_reporting = E_ALL | E_STRICT
According to the PHP manual all the constants of the extension begin with
PREG_* so you should get a notice about undefined constants:

http://es.php.net/manual/en/pcre.constants.php


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
--
Oct 22 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.