Rule type Regular Expression

Use this rule type to extract a value from a transaction field according to a regular expression. If the regular expression rule is used for a checkbox field, the checkbox field is checked if a match can be found. For example, let’s say you want to mark all transactions with the word ‘GIFT' in the payment reference. First, you create a ‘Has Gift’ checkbox custom field on Transaction, and then, using the Regular Expression rule type, create a rule with regular expression ‘GIFT’.

Guided Matching regular expression

   Remember to always validate your regex in a sandbox or test environment before applying to a production org.

Regular Expression setup

SettingDescription
Input FieldField from which a value is extracted using a regular expression.
Regular ExpressionThe regular expression used to match another string based on a specific syntax.
Multi-Value?If checked, all matched patterns are returned comma separated. If the total string is longer than fits in the Results field, only what fits is stored.
Capturing GroupFinDock uses the REgEx outcome of the defined capturing group to store on the Transaction field. See this Salesforce developer doc
Example InputExample text for the regular expression and capturing group. This is for testing and verifying that the regular expression behaves as expected.
Capturing GroupsAll the resulting capturing groups given the specified regular expression and example input.
ResultThe result given the calculated capturing groups and the specified capturing group.

   Stricter regex patterns help ensure long-term data integrity in your Guided Matching setup.

Regex tips and best practices

Regex resources and tools

There are lots of good resources and tools publicly available to help you build and test your regex rules. Here are just a few:

  • Salesforce REGEX - brief summary of regular expressions
  • Oracle Java documentation - includes a summary table of regular-expression constructs
  • RegExr - online tool for creating and testing regular expressions, licensed under GPL3
  • regular expressions 101 - online tool for creating and testing regular expressions with paid enterprise option
  • Common REGEX validations - some examples from Salesforce of common regex cases
  • AI - given its highly deterministic nature, regex is a good use case for AI. Several large language models have become very good at providing correct regular expressions based on example input and prompts explaining what pattens you want to find

Parsing amounts

When parsing amounts from inbound records, you may get an Invalid long error when trying to extract an amount value. The error occurs because the regex rule does not properly validate decimals, allowing invalid formats like 10.64.85.

Regex rule with invalid long error

To ensure correct parsing, use a rule that splits the value into two parts: whole number and decimal.

Example

Input string: {"value": "10.64"}

Regex: value"\s*:\s*"([\d]+).([\d]+)

  • Group 1 (Whole Number) = 10
  • Group 2 (Decimal) = 64
  • Result = 10.64

Regex rule with split value matching

Was this page helpful?