← Explore practical examples

FOUNDATION · ICU

Extract email addresses

Copy the pattern and text into a8s Regex, enable the flags shown, then paste the replacement to check the preview.

Pattern

([A-Z0-9._%+-]+)@([A-Z0-9.-]+\.[A-Z]{2,})

Flags

g, i

Sample text

Contact: hello@example.com
Support: help@example.org

Replacement

$1 [at] $2

Expected output

Contact: hello [at] example.com
Support: help [at] example.org

This example extracts simple addresses; it is not a complete email validator.

View on the App Store ↗