Following function walks away from pLocate in pSteps (signed) until pString does not match pRegex:
CREATE FUNCTION regexFromLocate( pString VARCHAR(255)
                               , pRegex  VARCHAR(255)
                               , pLocate VARCHAR(255)
                               , pStep   INT 
                               ) RETURNS VARCHAR(255)
BEGIN
  DECLARE len INT DEFAULT length(pString);
  DECLARE pos INT DEFAULT locate(pLocate,pString)+if(pStep>=0,length(pLocate),0);
  DECLARE i INT DEFAULT 0;
  DECLARE str VARCHAR(255);
  DECLARE res VARCHAR(255);
  REPEAT
     SET res =  str;
     SET i = i+pStep;
     SET str = if( pStep >= 0
                 , substring( pString, pos  ,  i)
                 , substring( pString, pos+i, -i)
                 );
  UNTIL (   ( pStep <  0 and i <= -pos )
         OR ( pStep >= 0 and i >= len  )
         OR str not regexp pRegex
        )
  END REPEAT;
  RETURN res;
END
Example:
mysql> SELECT regexFromLocate(string, '^[0-9]+$', 'x', -1) lNum
    ->      , regexFromLocate(string, '^[0-9]+$', 'x',  1) rNum
    ->   FROM ( SELECT 'hdpos1234x93m4s9034z1' string
    ->          UNION 
    ->          SELECT 'ryhp5x908m4s1s'
    ->        ) t;
+------+------+
| lNum | rNum |
+------+------+
| 1234 | 93   |
| 5    | 908  |
+------+------+
2 rows in set (0.00 sec)