Tag Archive: Regex

Oct 30

Format Phone Numbers in JavaScript

Here is a quick function that will grab any group of integers from a string so you may format phone numbers (or any number based formatting) quickly. By default this function formats phone numbers in standard 7 digit or 10 digit formatting. Example: 123-4567 and (123) 456-7890. The function matches all digits from a string. …

Continue reading »