XPath 1.0 doesn't handle regex natively, you could try something like
//*[starts-with(@id, 'sometext') and ends-with(@id, '_text')]
(as pointed out by paul t, //*[boolean(number(substring-before(substring-after(@id, "sometext"), "_text")))]
could be used to perform the same check your original regex does, if you need to check for middle digits as well)
In XPath 2.0, try
//*[matches(@id, 'sometextd+_text')]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…