Articles on: FAQs

How to form tags with regular expressions and/or substrings (Super-tags)?

How to form tags with regular expressions and/or substrings (Super-tags)



In DANAconnect, dynamic tags can be formed by combining variables with regular expressions and substrings to incorporate information from contact lists. These tags can be used in any of the available sending channels of the platform: email, enriched SMS, SMS, push, automated calls and APIs.

See more examples of super-tags here

Regular Expression Super-Tag
$s{label^regexp$}
The super-tag is formed with a variable, adding the regular expression ending with $.
Example of Regular Expression Super-Tag:
$s{nombres^(\S+\s*?){2}$}
With this example the second word of the nombres field is extracted.

IMPORTANT: Note that the character $ at the end of the regexp is required.

Substring Super-Tag
$s{nombre:length}
The super-tags can also simply get a substring or text string by adding :length, where length is an integer number representing the length of the string, and which can also be formed with negative numbers to start counting from the end of the word.
Example of Substring Super-Tag:
$s{Nombre:3}
With this example the first three letters of the nombre field are extracted.


Regular Expression Super-Tag Combined with Substring
$s{label^regexp$:length}
Optionally, in addition to the ^regexp$ a substring can also be added.
Example of Regular Expression Super-Tag Combined with Substring:
$s{nombres^(\S+\s*?){2}$:3}
With this example the first three letters of the second word of the nombres field are extracted.

NOTE: In case there are multiple groups in the regular expression, all groups will be concatenated as a result.

Updated on: 05/02/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!