Skip to content

Instantly share code, notes, and snippets.

@posulliv
Created June 19, 2013 21:21
Show Gist options
  • Save posulliv/5818178 to your computer and use it in GitHub Desktop.
Save posulliv/5818178 to your computer and use it in GitHub Desktop.
test
<?php
$test = '<div>(1) (4) (8) (22) (101)</div>';
$pattern = '/\((\d+)\)/';
$replacement = '<padraig>(${1})</padraig>';
echo preg_replace($pattern, $replacement, $test) . "\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment