Try the following code:
TAG POS={{!LOOP}} TYPE=A ATTR=data-hovercard:/ajax/hovercard/user.php?id=* EXTRACT=HTM
SET UID EVAL("'{{!EXTRACT}}'.match(/\/ajax\/hovercard\/user\.php\?id=(\d+)/)[1];")
PROMPT {{UID}}
solved how to extract UID facebook using imacros