<?php $variable = "foros-del-web23"; eregi("[a-b]+-*([0-9]*)", $variable, $numero); echo $numero[1]; ?>