Does this x5 [label=5] not work for you - i.e. generate each node’s label explicitly?
If not, no there is nothing in the Graphviz language similar to what you want.
However, the following gvpr (https://www.graphviz.org/pdf/gvpr.1.pdf) one-liner will strip the all alpha characters off each node name & assign the result to the node label. More string manipulation is available. (Note, gvpr uses ksh/bash pattern-matching syntax!)
Note that directly manipulating a label value containing escape-string characters is more work. The Graphviz parsers do not show expanded escape-chars until very late in the game - see: