View Single Post
Old 01-18-2005, 08:12 PM   #8
zaartix
Orange Mole
 
Join Date: May 2004
Location: russia, samara
Posts: 56
it's working for links like
http://www.domain.com/dir/index.php?razdel=about&mach[2]=20

so what if links will be like
http://www.domain.com/dir/index.php?razdel=about&mach[2]=20&mach[2]=20&mach[2]=20&mach[2]=20

PHP Code:
 $link "http://www.domain.com/dir/index.php?razdel=about&mach[/url][2]=20&mach[2]=20&mach[2]=20&mach[2]=20";
$no_one "[:%/?=&;\\,._a-zA-Z0-9\|+ ()~-]*";
$no_two "[:%/?=&;\\,._a-zA-Z0-9 ()~-]*";

if (
eregi("($no_one\[?$no_one\]?$no_one)",$link,$regs)) {
    echo 
$regs[1];
}
if (
eregi("($no_two\[?$no_two\]?$no_two)",$link,$regs)) {
    echo 
$regs[1];
}

// both print [url]http://www.domain.com/dir/index.php?razdel=about&mach[/url][2]=20 
return only this:
http://www.domain.com/dir/index.php?razdel=about&mach[2]=20&mach

Last edited by zaartix; 01-18-2005 at 08:15 PM.
zaartix is offline   Reply With Quote