hello all, i need to match this. http://rapidshare.com/files/331947036/hjs.zip PHP: (There is a space after zip) and change in to File is on rapidshare! PHP: First part "http://rapidshare.com/" is always same but rest of it will be different for every link. this is my code but id does not work. $fullpage = preg_replace("#http://rapidshare.com/(.+?)\ #i", "File is on rapidshare! ", $fullpage); PHP:
no there will be no link at all. http://rapidshare.com/files/331947036/hjs.zip is not a clickable link anyway.
The issue with your pattern is that you need to escape the the dot character -> . with a backslash as its considered a special character. $fullpage = preg_replace('~http://rapidshare\.com/files/[^ ]+~i', 'File is on rapidshare!', trim($fullpage)); PHP:
I do not know why but it turned into File is on rapidshare!js.zip PHP: I changed it into this and worked perfect. thanks alot. $fullpage = preg_replace('~http://rapidshare\.com/files/[\w]+/.+?\s~i', 'File is on rapidshare!', $fullpage); PHP: