# Text Pattern Stats

Statistics and frequency analysis of text patterns (numbers, emails, URLs, etc.)

> Canonical page: https://elysiatools.com/en/tools/text-pattern-stats

- **Category:** Text Processing

- **Keywords:** text, pattern, stats, regex, analyze, frequency, 文本模式, 统计

## Overview

Text Pattern Stats is a utility tool that performs frequency analysis on text to identify and count patterns such as numbers, email addresses, URLs, and more. It helps users extract statistical insights from unstructured text data quickly and accurately.

## Inputs

- **Text Input** (textarea): Enter text to analyze...
- **Pattern Type** (select)
- **Custom Regex Pattern** (text): Required when "Custom Regex" is selected. Can include flags like /pattern/gi
- **Case Sensitive** (checkbox)
- **Show Distribution** (checkbox)
- **Max Results** (number): Maximum number of results to return

## When to use

- When you need to count occurrences of specific patterns like numbers or emails in a large text document.
- When analyzing logs, reports, or datasets to find common elements such as phone numbers or dates.
- When preparing text data for further processing by extracting structured information based on patterns.

## How it works

- Input your text into the text area provided.
- Select a pattern type from the dropdown, such as numbers, emails, or URLs, or choose 'Custom Regex' to define your own.
- Configure optional settings like case sensitivity, show distribution, and maximum results.
- The tool scans the text and returns a JSON output with statistics, including frequency counts and distribution details if enabled.

## Use cases

- Extracting all email addresses from customer feedback forms for contact list generation.
- Counting the number of URLs in web scraping data to analyze link density.
- Analyzing a document to find and tally all dates mentioned for timeline or event tracking.

## Frequently asked questions

### What pattern types are supported?

Numbers, uppercase words, capitalized words, email addresses, URLs, phone numbers, dates, and custom regex patterns.

### Can I use my own regex pattern?

Yes, select 'Custom Regex' from the pattern type dropdown and enter your pattern in the custom regex field.

### What does the 'Show Distribution' option do?

It includes a frequency distribution chart in the JSON results, showing how often each pattern appears in the text.

### Is there a limit to the text length or number of results?

The tool can handle large texts, but you can set a maximum number of results (10 to 500) to control output size and performance.

### How are the results formatted?

Results are returned in JSON format, detailing each pattern found, its count, and distribution if enabled.

## Related tools

- [Text Pipeline Builder](https://elysiatools.com/en/tools/text-pipeline-builder): Run a portable text-cleaning recipe and inspect every step, diff, timing, and character change.
- [Bulk Email Extractor](https://elysiatools.com/en/tools/bulk-email-extractor): Extract all email addresses from input text, articles, web source code, or mixed content. Supports deduplication and export to JSON.
- [Log Parser - Apache/Nginx Access Log Parser](https://elysiatools.com/en/tools/log-parser): Parse Apache/Nginx access logs using regex patterns and extract structured data
- [Multi-Pattern Matcher](https://elysiatools.com/en/tools/multi-pattern-matcher): Match multiple regex patterns against text in one operation
- [Named Group Tester](https://elysiatools.com/en/tools/named-group-tester): Parse and display named capture groups from regex patterns
- [Regex Replace Previewer](https://elysiatools.com/en/tools/regex-replace-previewer): Preview regex replacements in real-time with detailed diff highlights and statistics
- [Vowel-Consonant Processor](https://elysiatools.com/en/tools/vowel-consonant-processor): Deterministically analyze, replace, remove, or duplicate English vowels and consonants with position statistics and an audit trail.
- [Line Number Remover](https://elysiatools.com/en/tools/line-number-remover): Remove line numbers from text or code with intelligent pattern recognition

## Samples

- [Regex Pattern Alternatives](https://elysiatools.com/en/samples/regex-alternatives): Multiple ways to write the same regex pattern with different trade-offs in readability, performance, and accuracy
- [Regex Replace Samples](https://elysiatools.com/en/samples/regex-replace): Collection of common and useful regex replacement patterns for text transformation and data cleaning
- [Regex Named Capture Groups](https://elysiatools.com/en/samples/regex-named-groups): Collection of regex patterns using named capture groups for extracting structured data from text. Named groups make patterns more readable and maintainable by assigning meaningful names to captured portions.
- [Android String Processing Java Samples](https://elysiatools.com/en/samples/android-string-processing-java): Android Java string processing examples including string split and join, regular expressions, and string replacement

## Related content

- [Observability Debugging from Logs, Traces, Webhooks, and JSON Payloads](https://elysiatools.com/en/hubs/observability-debugging): Parse logs, decode traces, inspect webhook/API evidence, explore JSON payloads, and extract recurring patterns before writing an incident-ready debugging note.
- [PII Detection and Log Redaction Review](https://elysiatools.com/en/hubs/pii-log-redaction): Find likely personal data in logs, text, and PDFs, redact review copies, validate identifier patterns, and require human approval before sharing.
- [Text Analysis, Readability, and Content Inspection Tools](https://elysiatools.com/en/hubs/text-analyze): Profile text files, counts, patterns, language, readability, sentiment, moderation signals, word frequency, and vocabulary options before editing or publishing.
