I'd like to surround the 2.5 with a span elemtent using regular expressions preg_replace. But only in the link name, not the URL.
<a href="mydomain.tld/2.5-Subchapter.php">2.5 Subchapter</a>
Anyone likes to help me with this challenge?
I did try this Regex validation on decimal already, but it didn't work for me.
Edit:
Thanks to ssc-hrep3's answer below, here the answer for a PHP solution (I forgot to mention it before):
$myNav = preg_replace('/(>)(\d\.\d+)/s', '$1<span>$2</span>',$myNav );
Kind Regards, Steffano