Method

extractPhoneNumbers — Extracts phone numbers from a text.

Description

This method is used to extract phone numbers from a given text. If one or more phone numbers are found inside a text it will extract a collection of phone numbers.

Minimum number of arguments for this method is one.

Structure of the method:

extractPhoneNumbers(text)

Parameters

text— this is the text that will be checked for containing phone numbers inside it.

Examples

In the example below, we will show all the extractPhoneNumbers fetches a collection of phone numbers from a text.

//Fetch email addresses from a text

{% set text = 'Flexie CRM has two main phone numbers for support, +355 (67) 300-2887 and +1(719) 645-7003. You can reach both numbers in case you need support.' %}

{% set phoneNumbersList = extractPhoneNumbers(text) %}

{% for phoneNumber in phoneNumbersList%}
{{phoneNumber}}
{% endfor %}

//Output:

// +355 (67) 300-2887
// +1(719) 645-7003

To stay updated with the latest features, news and how-to articles and videos, please join our group on Facebook, Flexie CRM Academy and subscribe to our YouTube channel Flexie CRM.