Smart Element Helpers: Expression and Format Fields
1 What are Helpers?
When using CSS Selectors to extract data from web pages, the raw extracted text may not be exactly what you need. Helpers are optional transforms you can attach to each variable to clean up, extract, or reformat data before it's applied to your email.
Each variable in the CSS selector configuration has four optional helper fields:
| Helper | Purpose |
|---|---|
| Modifier | Regex pattern to extract a substring |
| Replacement | The replacement string (uses capture groups) |
| Format | Number format pattern |
| Separator | Thousands separator character for numbers |
Helpers are an advanced feature. Most users don't need them — OG tag extraction and auto-mapping work without any transforms. Use helpers when source page data is messy or needs reformatting.
2 Modifier (Regex Pattern)
The modifier is a regular expression pattern applied to the extracted text. It lets you extract a specific part of a longer string.
Examples
- Extract price from text: Source text is "Price: $29.99 USD". Modifier:
(\d+\.\d{2}). Result:29.99. - Extract first word: Source text is "Samsung Galaxy Note 10". Modifier:
^(\S+). Result:Samsung. - Strip prefix: Source text is "SKU: ABC-123". Modifier:
SKU:\s*(.*). Result:ABC-123.
The modifier uses JavaScript regex syntax. Capture groups (()) define what to keep.
3 Replacement
The replacement string specifies what to output after the regex match. Use $1, $2, etc. to reference capture groups.
- Use first capture group: Replacement:
$1(most common) - Reformat with text: Modifier:
(\d+)\.(\d+), Replacement:$1 dollars and $2 cents - Wrap in HTML: Replacement:
<strong>$1</strong>
If no replacement is specified, the full match is used.
4 Format & Separator
For numeric values, the format and separator helpers control number display:
- Format — a number format pattern (e.g.,
#,##0.00for two decimal places with thousands grouping) - Separator — the character used for thousands separation (e.g.,
,for US format,.for European)
Example
Extracted value: 1499.9. Format: #,##0.00. Separator: ,. Result: 1,499.90.
Format and separator are most useful for price data extracted from e-commerce pages where the source format may not match your email's locale or style.
5 Next Steps
- What are Smart Elements? — the full Smart Elements guide with OG tags and CSS selectors
- What are Data Sources? — alternative to CSS selectors for structured data
Last updated: April 2026. All details verified against MiN8T's actual codebase implementation.