Code: Select all
$test = "<a href='test.php'>This is a test</a>'extra test";
$regex = "<\/a>[a-zA-Z0-9-]*'[a-zA-Z0-9]*[^\.\?,!\s]";I apologize if I gave a bit too much information and confused things.
Moderator: General Moderators
Code: Select all
$test = "<a href='test.php'>This is a test</a>'extra test";
$regex = "<\/a>[a-zA-Z0-9-]*'[a-zA-Z0-9]*[^\.\?,!\s]";Code: Select all
$test = "<a href='test.php'>This is a test</a>'extra test";
$regex = "<\/a>[a-zA-Z0-9-]*'[a-zA-Z0-9]*[^\.\?,!\s]";
echo preg_replace("/$regex/","$0$1</a>",$test);Code: Select all
$test = "<a href='test.php'>This is a test</a>'extra test";
echo preg_replace('%</a>([\-\w]*\'\w*)%i', '$1</a>', $test);