Common Regular Expressions for use in Routers (Non-XML conditions), Content Modifiers, and Message Mappings.
| Pattern |
Description / Use Case |
| 1. Routing & Logic Conditions |
(?i)error | Matches "Error" or "ERROR" (Case Insensitive). Useful for Exception Sub-processes. |
(?s).*fail.* | Dot-All Mode: Matches "fail" anywhere, even across multiple lines (e.g., inside an XML body string). |
^(true|false)$ | Boolean check. Matches exactly "true" or "false". |
^$ | Matches an Empty String (null/blank check). |
\S+ | Not Null/Empty: Ensures the field has at least one non-whitespace character. |
| 2. SAP IDs & Formats |
^\d{10}$ | SAP Document Number: Matches exactly 10 digits (e.g., Sales Order, Invoice ID). |
^0+$ | Matches strings containing only zeros (useful for filtering dummy IDs). |
^[0-9a-fA-F]{32}$ | 32-char GUID: Standard SAP GUID format (no dashes). |
^[0-9a-fA-F-]{36}$ | Standard UUID: 36 characters with dashes (e.g., 123e4567-e89b...). |
^ORD-\d+ | Starts with specific prefix "ORD-" followed by digits. |
| 3. Data Validation |
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ | Email Address: Standard validation pattern. |
^\d{4}-\d{2}-\d{2}$ | Date (ISO 8601): Matches YYYY-MM-DD format. |
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$ | DateTime (UTC): Matches YYYY-MM-DDThh:mm:ssZ. |
^[0-9]+(\.[0-9]{1,2})?$ | Currency/Amount: Positive number with optional 2 decimal places. |
| 4. String Cleansing (Replace) |
\s+ | Matches any whitespace (tabs, newlines, spaces). Replace with "" to trim. |
[^a-zA-Z0-9] | Remove Special Chars: Matches anything that is NOT a letter or number. |
[\r\n]+ | Matches Windows/Unix Line Breaks. Useful for flattening multiline text. |
^0+(?!$) | Matches Leading Zeros (e.g., convert 000123 to 123). |