All templates
Text ManipulationIntermediate
Extract Phone Numbers and Emails
Robomotion•Updated 9 months ago

Overview
Scans free-form text with regular expressions and pulls out every phone number and email address. Foundation for contact-harvesting jobs.
Extract Phone Numbers and Emails
Extracting specific data from documents can be challenging, as the targeted information may appear multiple times and in different formats throughout the text. Robomotion enables users to easily extract various text entities in natural language, such as emails, phone numbers, dates, currencies and measurement units.
What Extract Phone Numbers and Emails can do
- Input Dialog (
Core.Dialog.InputBox) titledRecognize & extract all phone numbers and emails from text, messagePlease provide a text:, default sample with an inline email and phone →msg.input_text. - Branch on cancel (
Core.Programming.Function,outputs: 2) — empty/cancelled input short-circuits toCore.Flow.Stop; otherwise continues. - Extract entities (
Core.Programming.Function) — runs an email regex and a phone regex againstmsg.input_text, writing matches (or aNo ... foundplaceholder) tomsg.recognized_emailsandmsg.recognized_phone_numbers. - Build results text (
Core.Programming.Function) — joins the two arrays into a singlemsg.dialog_textstring. - Message Dialog (
Core.Dialog.MessageBox,optType: info) titledFlow ran succesfully...displaysmsg.dialog_text, thenCore.Flow.Stop.
Behind the scenes
- Preserve the typo
succesfullyin the final dialog's title — it matches the original source. - Regex-based extraction is lightweight but will miss some international phone formats and can false-positive on URL-like strings; swap in a dedicated entity recognizer if that trade-off matters.
- When no matches are found, the Function node substitutes a human-readable placeholder string so the results dialog is never blank.
More text manipulation templates
See all 5 →- Concatenate Text FilesReads every .txt file in a directory and stitches their contents into a single output file. Useful for log rollups.
- Count Lines of a Text FileOpens a text file and reports the number of lines it contains. A tiny helper you can drop into larger analytics flows.
- Get Position of SubtextFinds the character index of a substring inside a larger string. A concise demo of the text-search primitives.
- Sort Lines of a Text FileReads a text file, sorts its lines alphabetically, and writes the result back out. Reusable for cleaning up exports and datasets.