📝 Overview
Regular expressions (regex) are powerful tools used for data extraction, replacement, and transformation.
In Yoom, you can utilize regex within data transformation operations like “Replace” and “Extract” to handle complex data patterns.
To perform these operations, you need to define patterns using regular expressions.
📖 Regular Expression Syntax Examples
Below are practical examples of regular expressions for data extraction and their corresponding results.
📍 Sample Base Data
Dear Yoom Users,
We hope this email finds you well.
This is Yoom Inc.
This is a test message for regular expressions.
Thank you for your attention.
[Regular Expression Test Text]
ーーーーーーーーーーーーーーーーーー
・Mobile Phone: 090-1234-5678
・Mobile Phone: 09012345678
・Landline: 03-1234-5678
・Toll-Free: 0120-123-456
ーーーーーーーーーーーーーーーーーー
・Postal Code: 101-0054
・Address: KANDA SQUARE 11F, 2-2-1 Kanda Nishikicho, Chiyoda-ku, Tokyo
ーーーーーーーーーーーーーーーーーー
・2019/01/23
・2019-01-23
ーーーーーーーーーーーーーーーーーー
・15:15
ーーーーーーーーーーーーーーーーーー
・This is a (Sample).
Yoom Operations Office
Mail: cs_yoom@yoom.fun
URL: https://yoom.fun
Office: KANDA SQUARE 11F, 2-2-1 Kanda Nishikicho, Chiyoda-ku, Tokyo
📍 Examples of Regular Expressions and Their Results
Data to Extract | Regular Expression | Example Output |
Email address |
| |
Domain |
| yoom.fun |
Mobile phone number |
| 090-1234-5678 |
Mobile number (no dashes) |
| 09012345678 |
Landline number |
| 03-1234-5678 |
Toll-free number |
| 0120-123-456 |
URL |
| |
Date ( |
| 2019/01/23 |
Date ( |
| 2019-01-23 |
Time ( |
| 15:15 |
Text after a specific String |
| KANDA SQUARE 11F, 2-2-1 Kanda Nishikicho, Chiyoda-ku, Tokyo |
Text between two strings |
| KANDA SQUARE 11F, 2-2-1 Kanda Nishikicho, Chiyoda-ku, |
Text inside ( ) |
| (Sample) |
💡 Advanced Regular Expression Techniques
1. Escaping Meta Characters
In regular expressions, certain characters have special meanings and need to be escaped with a backslash (\
) if you want to use them as normal characters.
Meta Characters
. ^ $ [ ] * + ? | ( ) \ /
📍 Example:
To extract 2023-05-01
from this string:
2023-05-01(Mon)
use this regex to exclude (Mon)
.
(.*)(?=\()
\(
→ Escapes the parenthesis to treat it as a normal character.
2. Extracting Text After Line Breaks
Use \n
to represent line breaks in regular expressions.
📍 Example:
Extract 「Name:John Yoom」from:
Company Name: Yoom Corp.
Name: John Yoom
Address:Tokyo
Regex:
(?<=\n)(.*)(?=\nAddress)
(?<=\n)
→ Extract after a line break(.*)
→ Captures the desired text(?=\nAddress)
→ Stops extraction before "Address"
3. Extracting Multiple Text (Including Line Breaks)
To capture text that spans multiple lines, use [sS]
to include all characters (including line breaks).
📍 Example:
Extract “This is a remark.”
Note
This is
a remark.
Company
Yoom Inc.
Regex:
(?<=Note)([\s\S]*)(?=Company)
(?<=Note)
→ Starts after "Note"([\s\S]*)
→ Matches any characters, including line breaks(?=Company)
→ Stops before "Company"
📚 Related Guides
List of Help Pages Regarding Regular Expressions - View Guide