andytan91 Posted August 14, 2010 Share Posted August 14, 2010 Hello guys i am trying regex this line string containing $parts = preg_split("/\.\(.*\)\.\(.*\)/", $file); Currently this is what i've done. I would like to only regex the value in the .* placing so i am putting hi as a replacement. However, it doesnt work..i have tried this out for very long..i hope someone can guide me..thanks:) $batch_contents = preg_replace('~\$parts = preg_split\(\"\/\\\.\\\((\.\*\\\)\\\)\\\.\\\((\.\*\\\)\\\)\/\", \$file\);~i' , '\$parts = preg_split\(\"\/\\\.\\\((hi\\\))\\\.\\\((hi\\\))\\\/\", \$file\);', $batch_contents); Quote Link to comment https://forums.phpfreaks.com/topic/210714-php-regex-help/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.