Daniel Rubio Daniel Rubio - 2 months ago 4x
jQuery Question

jquery to find numbers with regular expressions not working

I have a script to find numbers with in the following format


but it doesn't seem to be working. I tried finding phone numbers with only dashes and that worked but when adding the parenthesis doesn't seem to work

$(document).ready(function () {
$('body').html($('body').html().replace(/(\(\d\d\d\)-\d\d\d-\d\d\d\d)/g, '<span style="display:inline-block;">$1</span>'));

mmm mmm

If you want to find phone numbers like this (***)***-***, use