Skip to main content

Text & Lists

Occurrences Counter

Count occurrences in the supplied input. Enter the text, set the transformation rules, then copy the result.

Tool workspace

Your input stays in this browser.

Add the required input to continue.

Needs input

You can run the tool again after any change.

Options

Your result appears here

Count occurrences in the supplied input. Enter the text, set the transformation rules, then copy the result.

This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.

Occurrences Counter counts a search string in the input using regex, extended escapes, or simple-string matching.

2 Processing runs in the browser.

Instructions

  1. Provide text or data for this tool.
  2. Enter the search string in the operation field.
  3. Choose the matching mode that fits literal or regex input.
  4. Check zero matches before assuming the source contains the value.

Example

Input: red red blue

Settings: Occurrences Counter: Search for 'red' with Simple string.

Result: 2

Limits

  • Occurrences Counter: Invalid regular expressions return zero rather than a match count.
  • Occurrences Counter: The regex path uses case-insensitive matching.
  • Occurrences Counter: The operation runs in the browser and does not need a network service.