String Blocks

String blocks are handled at the text level. The result of a string block will be a string.


The REGEX block accepts a regular expression to search the content. For example:

{{REGEX[match=1]:/Phone: (\d{8})/mi}}

This will extract a phone number from the content.

The regular expression must have / to mark the start and end of the expression. The modifier can be specified after the end /.


match: Default is 0. This specifies the matched group to be returned from the regular expression. The default is to return the whole matched string.

For example, given that the source document is:

Screenshot of a piece of code.

The result of {{REGEX:/<img[^>]+src="([^">]+)"[^>]+alt="([^>"]+)"[^>]+>/}} is:

Screenshot of a piece of code.

The result of {{REGEX[match=1]:/<img[^>]+src="([^">]+)"[^>]+alt="([^>"]+)"[^>]+>/}} is:


The result of {{REGEX[match=2]:/<img[^>]+src="([^">]+)"[^>]+alt="([^>"]+)"[^>]+>/}} is:

Logo image

Read More

As this documentation is not explaining the regular expression itself, here are some websites to help you get started with regular expression:


The LITERAL block will simply return the text specified in the block. This is usually used to add static text in the rule expressions. For example:

{{LITERAL:Hello World}}

This will return string “Hello World”.

Book a demo

See how PerformX Content Workbench automates the migration of your site to Drupal. Fill in the form and you’ll be contacted shortly by someone from our team.