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); Link to comment https://forums.phpfreaks.com/topic/210714-php-regex-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.