<a href="#katya-pomerla-ot-diabeta">Катя съела 13 конфет</a> <script type="text/javascript"> alert( /\d+/.exec(document.getElementsByTagName('a')[0].innerHTML)[0] ) </script>