Regex delimiter problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
atu
Forum Newbie
Posts: 3
Joined: Sat Jun 21, 2003 10:45 am
Location: Luxembourg

Regex delimiter problem

Post by atu »

Some delimiters chars wont work under windows.
Ex. in preg_match:
"°[a-z]?°"
works on linux but on windows you get a warning:
Warning: Unknown modifier '?' in ........ on line xx


"/[a-z]?/"
works on both systems

So my question is: Are there similar problems in other functions or circumstances where such chars pose a problem under windows?

Thanks,
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

strange,

Code: Select all

<?php
$pattern = "°[a-z]?°";
$source = 'ab';
preg_match($pattern, $source, $matches);
print_r($matches);
?>
works fine for me on w2k/php4.3.2
what version do you use?
sure there isn't any other cause?
Post Reply