Regular Expression Search/Replace

Follow

With this feature you have the option to re-format / replace the value that comes in before it goes out.  This is not to be confused with the Output Format feature we have against fields on a delivery (which is limited).

The Regular Expression feature is an advanced feature that should be used if you have knowledge experience with Regular Expressions, specifically Patterns and Replacements.  We use this PHP Function: https://www.php.net/manual/en/function.preg-replace.php

System Area
This feature is found within your Delivery under the options button for the field

RegularExpression.gif

When Should I Use Regular Expression Search/Replace?

For this example, we will use a US telephone format - (555)555-5555

LeadByte allows you to select the Phone Pattern your leads will be inputted with:

Screen Recording 2022-03-23 at 03.30.11.70 PM

However, as this is not an exhaustive list, there will be instances where you will need (XXX)XXX-XXXX, (XXX)XXXXXXX This is where you can use Regular Expression Search/Replace.

In this example, the number 1234567890 needs to be captured as (123)456-7890, omitting the space after the bracket. The Search Pattern would be inputted as:

^([0-9]{1,3})([0-9]{1,3})([0-9]{1,4})$

And the Replacement would be:

($1)$2-$3

This means any 10 digit number would be converted into this format, ensuring that this field is compliant with your integration. .

A UK example has also been provided below:

Example

Example Pattern
^([0-9]{1,5})([0-9]{1,3})([0-9]{1,3})$


Example Replacement

$1-$2-$3

Outcome
This number format 07879000194 would be delivered as 07879-000-194

**Please note that the Phone Pattern selection is only available for US based deliveries**




Was this article helpful?
0 out of 0 found this helpful

Comments