Documentation Index

Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt

Use this file to discover all available pages before exploring further.

match-pattern()

Prev Next

Category: String functions

Checks whether a text value matches a given regular expression. Returns true if the pattern matches, otherwise false.

Syntax

match-pattern(a, b)

Parameters

Parameter

Type

Description

a

Text

The text value to check.

b

Text

A Java-compatible regular expression to match a against.

Return value

true if the regular expression b fully matches the text a, otherwise false.

Examples

Text (a)

Pattern (b)

Result

Explanation

ABCabc

^\w+$

true

The text consists only of word characters (letters, digits, underscore).

ABCabc

^\d+$

false

The text does not consist only of digits.

ABCabc

^[A-z]+$

true

The text contains only characters in the ASCII range A to z (includes uppercase and lowercase letters).

ABCabc

^[A-Z]+$

false

The text also contains lowercase letters. A pattern for uppercase letters only, therefore does not match.

order-12345

^order-\d+$

true

Matches the prefix order- followed by one or more digits.

2025-06-10

^\d{4}-\d{2}-\d{2}$

true

Matches a date in the format YYYY-MM-DD.

(empty)

^$

true

An empty string matches the pattern for empty.

Use cases

  • Data validation: Make sure incoming field values match an expected format before further processing (for example, a date, email, or item number).

  • Conditional mapping: Use match-pattern() inside a condition to control whether a mapping rule applies. For example, map a field only when its value starts with a certain prefix.

  • Filtering: Skip or forward records based on whether a field value matches a defined pattern.

Tips

  • The regular expression follows Java regex syntax (see java.util.regex.Pattern).

  • The pattern is matched against the entire text. Use .* at the start or end to allow a partial match (for example, .*keyword.*).

  • Tools such as regex101.com are useful for testing expressions (select the Java flavor).

  • Starting with Release 26.2: The validity of a regular expression is automatically checked when you use Pathfinder for evaluation. You receive feedback from Pathfinder indicating whether the expression is correct or contains mistakes.

Function

Description

cut-until-match(a, b, c)

Removes characters from a text until the remaining string matches a regular expression.