Jump to content

PHP regex help


andytan91

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.