REGEX to extract phone number from Text

Hi Makers,

I’m trying to extract a phone number from a text.

I tried multiple Regular Expressions but it does not match any pattern.

Here is one of the Regex I used : /+?\d{1,4}?[-.\s]?(?\d{1,3}?)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}/g

I want to retrieve this kind of phone number from a text :

+32484487694
0484487694
0484 48 76 94
0032484487694

Is there anyone who could help me please ?

Thanks !



Try this.

Lots of great resources to help you there.

2 Likes

Thanks I will a look.

I found this regular expression on regex101: Regex for telephone numbers all over the world

I did some test on their website and the expression seems to work out (see screenshot). When I copy/past it into the text parser, it does not find anything. How come ?

Thanks for your help.


You don’t need the leading and trailing / characters.

Also you need at least one capture group. () will do it around your whole pattern.

Hi Alex,

Thanks for you help.

I’m not sure I understood what you said (sorry I’m a non-tech guy :stuck_out_tongue: )

How should I write it in the text parser module ?

I tried this :

(/+?\d{1,4}?[-.\s]?(?\d{1,3}?)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}/g)

But it doesn’t work.

Best,

Try

(\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9})

Also work it in regex101.com first

1 Like

And if you need more help I’ll do the Regex work for you but with our make hero

We offer a one hour video call where we explain and show how Make can help your organization. We even build some scenarios and share them with you so get more value than a usual exploratory discussion. Book some time with me at Make.com Hero - NewPath Consulting I look forward to talking to you and your team should they join us.

1 Like

I’ve tested the pattern above and updated it:

(\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9})

The + and () needs to be escaped.