Nothing is sent without a yes

Bot Cookbook

Search the index

Search templates, guides, and prompts.

Prompt

Write and test a regex: Grok Bot prompt

A regular expression for the named pattern, tested against the examples, showing which match.

Updated 15 Oct 2026.

We've tried this one (last run 14 Oct 2026).

Are you the creator? Ask us to remove this.

Prompt

Write a regular expression that matches [pattern]. Test it against these examples and show which match: [examples]

Fill in

  • [pattern]
  • [examples]

Connectors

none

Uses this feature

Cloud computer · Computer and apps

Which task is “Write and test a regex” written for?

Use “Write and test a regex” when you want the bot to do this job: “Write a regular expression that matches [pattern]. Test it against these examples and show which match: [examples].”

What do I replace in “Write and test a regex” before I send it?

In “Write and test a regex”, where it says “regular expression that matches [pattern]. Test it”, put the pattern you mean and where it says “and show which match: [examples]”, put the examples you mean. Send it without [pattern] and [examples] still sitting in the text.

What does a finished “Write and test a regex” look like?

A finished run of “Write and test a regex” looks like this: “A regular expression for the named pattern, tested against the examples, showing which match.” Check the reply against the job you gave it: “Write a regular expression that matches [pattern]. Test it against these examples and show which match: [examples].”

What should I double-check before I trust “Write and test a regex”?

The miss with “Write and test a regex” is sending [pattern] and [examples] through as if they were real values. Fill them so the reply can still match “A regular expression for the named pattern, tested against the examples, showing which match.”