first-regex-match

The first-regex-match operation searches for the first occurrence of a given regular expression pattern in the input text.

If a match is found, the first matching substring is returned. If no match is found or the pattern cannot be applied, the operation returns an empty string.

How it works

  • Pattern – the regular expression used for matching.
  • Input – the text value to search in. Usually some form field.
  • Result – the first matching substring, or an empty string if there is no match.

Examples

PatternInputOutput
\d+Order n. 1234512345
[a-z]+123 ABC xyzxyz
\d+no number“” (empty string)

Usage in PalDock

Use first-regex-match when you need to:

  • Extract the first number from a text string (e.g. order IDs, invoice numbers).
  • Capture a specific word or token from longer text.
  • Parse identifiers embedded in unstructured input.

Test your regex

AI tools can help generate regular expressions, but they may produce incorrect or overly complex patterns. Always test your regex before saving it. A free tool like regex101.com lets you quickly check how your pattern behaves, validate capturing groups, and confirm backreferences.

Best Practices

  • Keep patterns as simple and specific as possible to avoid unexpected matches.
  • Remember: only the first match is returned. If you need multiple matches, use a different approach or chain operations.
  • If no match is found, the output will be an empty string so ensure your flow can handle that case.

Insights that
helps you grow

  • Release notes 2025/12/19
    We added country-based categorization. You can now categorize offers, integrations, and other items by a specific country, or keep them global across all markets. We also…
  • Release notes 2025/12/17
    More flexible lead rejection: based on validation rules, filters, or pingtree sales results, by source (iframe, API) or by partner (include / exclude). It is now possible to…
  • Case study: How Lender Orka Ventures Scaled Affiliate Operations
    Orka Ventures, an online lending group that wanted to scale fast across countries and onboard affiliates quickly. Their custom affiliate API and tracking layer soon…