poe Posted November 5, 2011 Share Posted November 5, 2011 i need to replace all text references that have vbHmo characters from : this -> that: vbHm0_156.js -> vbHm0_156.xx vbHm0_1409.js -> vbHm0_1409.xx vbHm0_1267.js -> vbHm0_1267.xx the # after the _ is a random number and can be either 1 to 5 digits inlength.. so basically all i am fdoing is changing the .js to .xx Link to comment https://forums.phpfreaks.com/topic/250476-another-preg-replace/ Share on other sites More sharing options...
requinix Posted November 5, 2011 Share Posted November 5, 2011 Sounds simple enough. What have you tried so far? Link to comment https://forums.phpfreaks.com/topic/250476-another-preg-replace/#findComment-1285147 Share on other sites More sharing options...
poe Posted November 5, 2011 Author Share Posted November 5, 2011 i think this seems to work.. $html = preg_replace('#Hm0_([0-9]+).js#', 'Hm0_\1.xx', $html); thanks chris Link to comment https://forums.phpfreaks.com/topic/250476-another-preg-replace/#findComment-1285149 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.