Regular Expression Search/Replace
This article goes over the Regular Expression Search/Replace feature that is available to use when formatting data fields in your deliveries. This will allow you to re-format / replace the value that comes in, outputting a new value.
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 configuration, under the options button for a field.
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:
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 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**
Comments