Javascript Regular Expressions – Replace non-numeric characters February 6, 2023 by Tarik Simply: var.replace(/[^\d.-]+/g, '');