473,499 Members | 1,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PCRE question

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
1 1832
*** 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2724
by: Markus Elfring | last post by:
Hello, I try to use alternative delimiters for a regular expression. When will it be supported? www@mike:/home/www > /usr/local/bin/php -a Interactive mode enabled <?php...
3
1974
by: news | last post by:
Hi all, I am a beginner on 'c' and pcre...and I am on windows 2000 and VC6 with all of the patches, etc. The following program leaks lots of memory and I only make 1 pcre call. I read the...
17
2087
by: sgane2001 | last post by:
Hi, I'm using pcre.c to provide regex support for my application software. I want to know how to do 'AND' operation in this. I didn't got any useful info from the net. Is this operator...
2
3911
by: Bernd Muent | last post by:
Hi together, most of the time I'm using .net framework to programm C++. F.E. I can do the following: Regex* rex; String*...
16
3146
by: mainland | last post by:
I use prce to match string. I define a pcre struct point, then compile, pass pcre struct point to 'pcre_compile'. When complete, Is it necessary to use 'pcre_free' to free pcre struct point. ...
2
5666
by: Serman D. | last post by:
Hi all, I'm trying to complete the samples from the excellent 2003 developerWorks article "Bringing the Power of Regular Expression Matching to SQL" by Knut Stolze: http://tinyurl.com/3bhrnn...
13
7457
by: Wiseman | last post by:
I'm kind of disappointed with the re regular expressions module. In particular, the lack of support for recursion ( (?R) or (?n) ) is a major drawback to me. There are so many great things that can...
9
2412
by: xoinki | last post by:
hi all, How to fetch last successfully matched pattern using PCRE? it seems that $& easily gives successfully matched pattern. but In PCRE i am unable to find the equivalent :(. Please...
1
2429
by: moreati | last post by:
Recently I discovered the re module doesn't support POSIX character classes: Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) on linux2 Type "help", "copyright", "credits" or "license" for...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.