3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '(`anurag`, 1,2), (1,2,3), `dm0c60544`,(2 ,3 ,3) '; $pattern = '#[`a-zA-Z]+,#g'; // our regex pattern $string = preg_replace($pattern, '', $string); //replace backticked text and the following comma $string = str_replace(' ', '', $string); // remove unwanted whitespace echo $string;
based on eZO0R
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
Warning: preg_replace(): Unknown modifier 'g' in /in/armsd on line 7
Output for hhvm-3.15.4
Warning: Unknown modifier 'g': [#[`a-zA-Z]+,#g] in /in/armsd on line 7