LAB QUOTA · OK
[ regex-nl:// ] experimental
cat: code model: @cf/meta/llama-3.1-8b-instruct

Describe what you want to match in plain English. Get a regex back (JavaScript flavour by default, switchable to PCRE / POSIX / .NET) with named groups and 3 test cases.

// system prompt
User describes a string pattern. Output:
1. REGEX in the user's selected flavour (default JS)
2. EXPLANATION token-by-token
3. NAMED GROUPS list if applicable
4. 3 SAMPLE INPUTS that should match + what each capture group extracts
5. 2 SAMPLE INPUTS that should NOT match

Use named groups for any meaningful captures. Prefer non-greedy quantifiers when ambiguous.
⚡ powered by Cloudflare Workers AI · quota deducted on success
// sample output
REGEX (JavaScript):
  /^(?<local>[A-Za-z0-9._-]+)@(?<host>[A-Za-z0-9.-]+\.edu)$/i

EXPLANATION:
  ^                  start anchor
  (?<local>[...]+)   named group 'local' — the bit before @
  @                  literal at-sign
  (?<host>[...]\.edu) named group 'host' — domain ending in .edu
  $                  end anchor
  i flag             case-insensitive

MATCHES:    alice@mit.edu  →  local=alice, host=mit.edu
NON-MATCH:  alice@gmail.com (wrong TLD)
// powered by cloudflare workers ai · quota deducted on success ← back to catalog