One way is: First, remove the starting $, replace all non digit from the remaining string, then pre-pend the $ to the digit-only string. e.g.
<script>
str = "$68ab6$7$";
withoutFirst$ = str.replace("$", "");
removeNonDigits = withoutFirst$.replace(/[^\d]/g, "");
alert("$" + removeNonDigits);
</script>
Demo at
JSFiddle[
^]
BTW, to find any word than starts with a $, try this regex pattern:
/^\$.+/g