All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Image Tools Video Tools Audio Tools Subtitle Tools Font Tools
Analyze Tools Clean Tools Compress Tools Convert Tools Edit Tools Extract Tools Generate Tools Merge Tools Organize Tools Redact Tools Repair Tools Split Tools
Analyze Tools Clean Tools Compare Tools Convert Tools Extract Tools Generate Tools Merge Tools Transform Tools Validate Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

Custom Regex Extractor

Write a JavaScript regular expression and pull out matching text from your input, with capture groups, flags, line numbers, and surrounding context.

Flags

How to extract matches with a custom pattern

Enter a JavaScript regular-expression pattern and the text to search. The tool finds all matches automatically and shows the selected values in the read-only output box. Results update when you change the pattern, input text, flags, Extract: selection, or Unique only.

Controls and matching options

Enter the pattern between the displayed slash marks; do not add another pair of surrounding slash delimiters. The interface starts with i (case-insensitive) and Unique only enabled. The other flags start disabled.

  • i (case-insensitive) ignores letter case while matching.
  • m (multiline) enables multiline regular-expression behavior.
  • s (dotall) lets the dot match newline characters.
  • Extract: choose Full match or a numbered Group N when the pattern has capture groups.
  • Unique only removes repeated selected values. Matching is always global; there is no separate global-flag control.

Use the tool step by step

  1. Enter a JavaScript regular-expression pattern in the pattern field.
  2. Enable i (case-insensitive), m (multiline), or s (dotall) if the pattern needs those options.
  3. Paste text into the input area, or use Upload or Drop file to load a file.
  4. Under Extract:, select Full match or a numbered capture group.
  5. Review the updated output and result table. Use Copy or Download when you need the extracted values elsewhere.

Upload text and handle files

Upload opens a file picker filtered to .txt, .csv, .json, and .log. The page reads the selected file as text and places it in the input area. Dropped files are also read as text; the page-specific drop handler does not visibly type-check the dropped file before reading it.

Understand results, deduplication, and export

The read-only output box lists extracted values separated by newlines, and the footer shows the result count. The table can show the selected value under Match, its Line number, and a short Context snippet around the match.

With Unique only enabled, duplicates are removed using the selected extracted value. Therefore, switching from Full match to Group N can change which rows count as duplicates. Turn it off when repeated values should remain in the output.

Copy copies the output text. Download saves the newline-separated values as the plain-text file regex-matches.txt.

Troubleshooting and limitations

  • An empty pattern or empty input produces 0 matches.
  • An invalid JavaScript pattern clears the results and shows the regular-expression engine error below the pattern field.
  • If a selected capture group did not participate in a match, its extracted value is empty.
  • The matching workflow uses JavaScript RegExp behavior. PCRE or Python syntax is not guaranteed to work, especially for advanced constructs.
  • The tool runs the pattern as written; it does not perform semantic validation for a particular data type. No local input-size limit is documented.

Matching is performed locally in the browser by this page's script. That describes the matching workflow only and is not a universal privacy or security guarantee for the whole website.

Frequently Asked Questions (FAQs)

What regex flavor does this tool use?

Standard JavaScript regular expression syntax, since matching runs directly in your browser. PCRE or Python syntax is not guaranteed to work, especially for advanced constructs.

Can I extract a specific capture group instead of the whole match?

Yes. If your pattern includes parentheses to define capture groups, the Extract: control lets you choose whether to extract the full match or a specific numbered group.

What happens if my pattern is invalid?

The tool shows the JavaScript regex engine's error message right under the pattern field, so you can fix typos or unbalanced parentheses immediately.

Why is this separate from the preset entity extractors?

Preset extractors (emails, phone numbers, addresses, etc.) hardcode patterns tuned for a specific entity type. This tool instead hands full control of the pattern to you, which suits developer workflows, log parsing, and one-off extraction tasks that don't match a preset.

Related Tools

3 views