exclude non-numeric characters (or special characters) from telephone numbers with the use of regex

claudia80

Banned - Rules violations
Joined
Sep 2, 2017
Messages
14
Good morning.
I would like to improve a regex expression to make sure that the mobile number is recognized even if there are non-numeric characters between the digits such as:. - etc.
I read that you have to enter \ D or \ W but it doesn't work.
Can you help me?

(\((00|\+)39\)|(00|\+)39)?(39[0-37-9]|38[02-589]|34[0-9]|36[0-3680]|33[13-90]|32[2347890]|35[0-35]|37[0-9])(\s?\d{3}\s?\d{3,4}|\d{6,7})

regex expression valid for all numbers listed except for numbers with the addition of characters to exclude with the new version:

site for checking regex expression:

list of numbers:
320123456
3201234567
320 123456
320 1234567
320 123 456
320 123 4567
39320123456
393201234567
39 320123456
39 320 123456
39 320 123 456
39 320 123456
39 320 123 456
39320123456
393201234567
+39 320123456
+39 320 123456
+39 320 123 456
+39 320 123456
+39 320 123 456
39320123456
393201234567
0039 320123456
0039 320 123456
0039 320 123 456
0039 320 123456
0039 320 123 456
(+39) 320123456
(+39) 3201234567
(+39) 320123456
(+39) 320 123456
(+39) 320 123 456
(+39) 320 123456
(+39) 320 123 456
(0039) 320123456
(0039) 3201234567
(0039) 320123456
(0039) 320 123456
(0039) 320 123 456
(0039) 320 123456
(0039) 320 123 456
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
with Power Query
is that what you want to achieve?
list of numbers:Numbers
320123456320123456
32012345673201234567
320 123456320123456
320 12345673201234567
320 123 456320123456
320 123 45673201234567
3932012345639320123456
393201234567393201234567
39 32012345639320123456
39 320 12345639320123456
39 320 123 45639320123456
39 320 12345639320123456
39 320 123 45639320123456
3932012345639320123456
393201234567393201234567
+39 32012345639320123456
+39 320 12345639320123456
+39 320 123 45639320123456
+39 320 12345639320123456
+39 320 123 45639320123456
3932012345639320123456
393201234567393201234567
0039 3201234560039320123456
0039 320 1234560039320123456
0039 320 123 4560039320123456
0039 320 1234560039320123456
0039 320 123 4560039320123456
(+39) 32012345639320123456
(+39) 3201234567393201234567
(+39) 32012345639320123456
(+39) 320 12345639320123456
(+39) 320 123 45639320123456
(+39) 320 12345639320123456
(+39) 320 123 45639320123456
(0039) 3201234560039320123456
(0039) 320123456700393201234567
(0039) 3201234560039320123456
(0039) 320 1234560039320123456
(0039) 320 123 4560039320123456
(0039) 320 1234560039320123456
(0039) 320 123 4560039320123456
 
Upvote 0
No.
I have a macro that extracts mobile phone numbers from websites.
If there is a number on a website that contains a symbol such as:. /
does not extract it.
So I would need to improve the regex expression so that the macro also recognizes the numbers that have those symbols inside them.
these symbols can be added to the list of numbers I entered earlier on the regex expression verification website.
The regegex expression should consider numbers not taking symbols into account
 
Upvote 0
you can define what you want to extract: Text.Select([#"list of numbers:"],{"0".."9","/","+"})
but I don't want to bother with regex in vba
good luck :)
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,323
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top