Regex Helper
Pricing
$0.01 / 1,000 processed texts
Regex Helper
Apply named regular expressions to submitted text or an Apify dataset. Get matches by pattern with values, positions, capture groups, and a total match count.
Pricing
$0.01 / 1,000 processed texts
Rating
0.0
(0)
Developer
Maxime Dupré
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Share
🧩 Find regex matches in a batch of text
Regex Helper is for developers, data teams, and business teams that need structured matches from text. Apply named Python-compatible regular expressions to pasted text or rows in an Apify dataset. Get each match value, its position, capture groups, named groups, and a total match count.
- Pull LinkedIn references from text with the LinkedIn Extractor preset.
- Find links in each text with the URL Extractor preset.
- Pull phone numbers from a text batch with the Phone Number Extractor preset.
- Find email addresses in text with the Email Extractor preset.
- Apply your own named patterns with the Regex Matcher preset.
📦 Returned data
The Actor saves one row for each processed text. Matches are grouped by your pattern names. A pattern gets an empty array when it finds no match, so you can still see which patterns were checked.
For each match, you get the full value, zero-based start and end positions, numbered capture groups, and named capture groups. You can ask for every occurrence or only the first occurrence for each pattern in each text.
▶️ Running the Actor
- Choose Submitted texts or Apify dataset as the target.
- Add your text, or choose a dataset and the field that holds its text.
- Keep the ready-made patterns, or add your own named patterns.
- Choose all or first match mode and any regex flags.
- Run the Actor and open the dataset.
The ready-made patterns find emails, phone numbers, URLs, and LinkedIn references. They find text that fits each pattern. They do not prove ownership, identity, or deliverability.
🧾 Input
| Field | Type | What it does |
|---|---|---|
target | string | Chooses text entered in the form or rows from an Apify dataset. |
texts | array of strings | Lists text values to process when target is texts. Each value is handled on its own. |
datasetId | string | Selects the Apify dataset to read when target is dataset. |
datasetTextField | string | Names the dataset row field that holds the text. The default is text. |
patterns | array of objects | Sets custom named Python-compatible regular expressions. Leave it empty to use the ready-made contact patterns. |
patterns[].name | string | Gives a pattern its unique output group name. |
patterns[].expression | string | Sets the Python-compatible regular expression. |
matchMode | string | Uses all for every occurrence or first for only the first occurrence per pattern and text. |
flags | array of strings | Applies IGNORECASE, MULTILINE, DOTALL, VERBOSE, or ASCII to all custom patterns. |
This example is the public input from a successful run with the default text:
{"target": "texts","texts": ["Team contacts:\nsupport@example.com and sales@example.com\nCall +1 (415) 555-0134\nVisit https://example.com/help\nLinkedIn: linkedin.com/company/example"],"datasetTextField": "text","matchMode": "all"}
The Actor checks the input before it starts. Invalid regular expressions, unknown flags, and repeated pattern names cause a clear error.
📊 Output
Each dataset row has this shape:
| Field | Type | What it does |
|---|---|---|
text | string | Holds the full text that was processed. |
matchCount | integer | Counts all matches across all patterns. |
matchesByPattern | object | Groups match arrays by pattern name. |
matchesByPattern.<name> | array of objects | Lists matches for one pattern, or an empty array when none were found. |
matchesByPattern.<name>[].value | string | Holds the full matched value. |
matchesByPattern.<name>[].start | integer | Gives the zero-based position where the match starts. |
matchesByPattern.<name>[].end | integer | Gives the zero-based position just after the match ends. |
matchesByPattern.<name>[].groups | array | Lists numbered capture values in pattern order. A missed group is null. |
matchesByPattern.<name>[].namedGroups | object | Maps named capture groups to their values. A missed group is null. |
{"text": "Team contacts:\nsupport@example.com and sales@example.com\nCall +1 (415) 555-0134\nVisit https://example.com/help\nLinkedIn: linkedin.com/company/example","matchCount": 5,"matchesByPattern": {"emails": [{"value": "support@example.com","start": 15,"end": 34,"groups": [],"namedGroups": {}},{"value": "sales@example.com","start": 39,"end": 56,"groups": [],"namedGroups": {}}],"phoneNumbers": [{"value": "+1 (415) 555-0134","start": 62,"end": 79,"groups": [],"namedGroups": {}}],"urls": [{"value": "https://example.com/help","start": 86,"end": 110,"groups": [],"namedGroups": {}}],"linkedinReferences": [{"value": "linkedin.com/company/example","start": 121,"end": 149,"groups": [],"namedGroups": {}}]}}
💳 Pricing
This Actor uses pay-per-event pricing. You pay for each processed text saved to the dataset. The charge covers the text row and its match data, including rows where the checked patterns find no match.
🔌 Integrations
Use the dataset through the Apify API, webhooks, schedules, or Apify integrations. This video shows how to connect an Actor to other tools:
❓ FAQ
Can it scrape text from a website?
No. The Actor only checks text you submit or text in an existing Apify dataset. Use a text extraction Actor first if you need to fetch a page.
Can I use my own patterns?
Yes. Add one or more unique names and Python-compatible regular expressions in patterns. Custom patterns replace the ready-made patterns for that run.
What happens when a pattern finds nothing?
The output keeps the processed text and the pattern name. That pattern has an empty match array, and matchCount shows the total across all patterns.
Can it replace or clean the matched text?
No. It finds and describes matches but does not rewrite the input text.
How does first match mode work?
For each pattern and each text, first saves only the first occurrence. Use all to collect every occurrence.
📝 Changelog
0.0: Initial release
- Extract structured matches with positions and capture groups from submitted text or Apify dataset rows using built-in or custom named regex patterns.
🆘 Support
For issues, questions, or feature requests, file a ticket and I'll fix or implement it in less than 24h 🫡
🔗 Related Actors
- Webpage Text Extractor fetches clean text or Markdown from public web pages before you run regex patterns on it.
- Unicode Text Inspector checks text for hidden characters, bidi controls, and homoglyphs.
- Website Emails Scraper finds public email addresses by crawling websites.
- Email MX Verifier checks the syntax, MX records, and risk signals of email addresses you already found.
- Phone Number Validation API checks and formats phone numbers found in text.
Made with ❤️ by Maxime Dupré