Re: Negative Look Ahead Regex - Code Mistake or Bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ash,

> As far as I can tell, you have an error in your syntax. You're using a -
> (hyphen) character in the first match, but Regex uses this to define a
> range of characters. It seems that if you don't escape it, the whole
> thing behaves a little strangely. For example, using your URL as the
> source string:
> 
> http://www.domain.com/path1/path2.php?PHPSESSID=2u0ccaffoh6jaeapkke35qpp87;
> 
> This regular expression
> /^(http:\/\/www\.domain\.com([\/\.\-\_\w]*))/
> matches
> [!MATCH!]?PHPSESSID=2u0ccaffoh6jaeapkke35qpp87;

Thanks for your reply. I updated the code at the URL below adding your
suggestion, but it doesn't seem to make a difference.

http://www.kottmann.com/test.php

Even if there is a problem with the meta characters, I don't understand how
or why the SID would be added in between the .ph and the p in the extension.
It's just totally bizarre to me and is why I'm wondering if it's a bug. (See
links 1 & 8 by viewing source at the link above)

You or anyone have other ideas to try?

Thanks,
Cameron



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux