URL · API · HTTP · Security

Regex Builder Online

Use this easy visual regex builder to create JavaScript patterns for URLs, APIs, HTTP requests, and logs. The guided regex builder wizard explains each pattern and tests examples that should and should not match.

Start with intentChoose path, host, parameter, filename, or header.
Prove the behaviorRun SHOULD MATCH and SHOULD NOT MATCH cases.
Private by designParsing and testing stay in your browser.

Interactive workbench

Build, test, and export a JavaScript regex

Online regex builder tool validated with your browser's JavaScript engine · 50,000-character safety limit

Guided builder

Build one reliable request pattern

Work from a real example, select only the request field you need, then define what may change.

JavaScript engine
1 Add example2 Choose target3 Set rules4 Verify
1
Start with a real requestPaste a full URL or a URI path, then review the parsed parts.
Scheme
https
Hostname
api.example.com
URI path
/v1/users/123
Query
debug=true
2
Choose one field to matchPrefer the smallest field that meets the requirement.
3
Define what stays fixed and what can changeMark changing path segments such as IDs
/
Options
Ready to verify?The generated pattern and test cases will appear below.
Or start from a networking preset
Valid JavaScript regex
g
JavaScript flags

Sample input

Paste a request, URL, config, or log
0 characters

Match preview

Matches are highlighted
0 matches

Match information

0 ms

Matches will appear here.

Plain-English explanation

What the pattern does

Performance warning

Low risk

Behavior check

Prove what should and should not match

Waiting for tests

Export / syntax guidance

Not cross-engine validation

Only the JavaScript pattern is executed here. Server products can use different regex engines and escaping rules.

Replacement preview

Supports $1 and named groups

Standard operating procedure

SOP: Build and approve a request regex

Use this procedure whenever a pattern will be added to an application, reverse proxy, WAF, monitoring rule, or log search.

Open the builder
ObjectiveCreate the narrowest pattern that accepts valid requests and rejects near-matches.
Required inputsOne real request, two valid variations, and three examples that must fail.
Approval ownerThe engineer responsible for the destination system or security rule.
  1. 01

    Capture representative examples

    Collect a real URL or request value. Remove credentials, tokens, session IDs, and personal data before pasting.

    Evidence: at least two valid examples and three invalid or near-match examples.

  2. 02

    Select the smallest request field

    Choose URI path, hostname, query parameter, filename, extension, or header. Use Full URL only when scheme and hostname are genuinely part of the rule.

    Decision: document why the selected field is sufficient.

  3. 03

    Classify every changing value

    Keep stable path segments exact. Mark only true variables as Numeric ID, UUID, slug/name, or any segment. Enable query strings, subdirectories, case-insensitivity, or a trailing slash only when required.

    Control: avoid broad wildcards when a specific value type is known.

  4. 04

    Generate and review the pattern

    Select Generate & verify pattern. Read the plain-English explanation and confirm the anchors, dynamic segments, and optional parts match the requirement.

    Stop if: the explanation describes a broader scope than intended.

  5. 05

    Prove positive and negative behavior

    Add each expected value under SHOULD MATCH and each rejected value under SHOULD NOT MATCH. Include empty values, extra path levels, malformed IDs, unexpected punctuation, case changes, and long non-matching input.

    Pass condition: every case reports Pass and the performance warning is acceptable.

  6. 06

    Export, peer-review, and deploy safely

    Choose the destination in Export / syntax guidance. Verify syntax in that product because JavaScript, Nginx, Apache, WAF, and log engines can differ. Save the pattern, flags, test cases, owner, and rollback method with the change record.

    Approval: peer review completed before production use.

Release gate

Definition of done

  • All positive and negative tests pass
  • No unexplained performance warning
  • Destination-engine syntax verified
  • Pattern, flags, owner, and rollback recorded

What is regex and what is regex used for?

Regex, short for regular expression, is a compact pattern language for finding, validating, extracting, splitting, or replacing text. A regex pattern combines literal characters with operators that describe allowed characters, positions, alternatives, groups, and repetitions. Common uses include validating form input, extracting values from logs, finding code, matching URLs, and transforming structured text.

How to write regex

Begin with real examples that should and should not match. Keep fixed text literal, replace only variable parts with specific character classes or groups, add start and end anchors when the entire value must match, and test edge cases before deployment.

How to use regex

Choose the regex function supplied by your language or product, pass it the pattern and input text, then inspect matches or replacements. Because engines differ, test the pattern in the same environment where it will run.

What is regex in Python, JavaScript, and Java?

Python uses the re module, JavaScript uses RegExp objects or regex literals, and Java uses java.util.regex. The core concepts overlap, but supported features, flags, and string escaping can differ.

What is regex in SQL?

Regex in SQL filters or extracts text using database-specific operators or functions. PostgreSQL provides regex operators, MySQL provides REGEXP and REGEXP_LIKE, and other database systems use different syntax or may not include native regex support.

Regex syntax quick reference

TokenMeaningExample
^ and $Start and end of input, or line with the multiline flag^hello$
.Any character except a line break unless dot-all is enableda.c
\d \w \sDigit, word character, and whitespace classes\d{4}
[A-Z]One character from a set or range[A-F0-9]
* + ?Zero or more, one or more, and optionalhttps?
{n,m}A specific repetition range\d{2,4}
(...)Capturing group(cat|dog)
(?:...)Non-capturing group(?:https?://)?
\bWord boundary\bcat\b
|Alternative choicesyes|no

Regex flags explained

Global and case-insensitive

g finds every match instead of the first. i ignores letter case.

Multiline and dot-all

m changes how anchors work across lines. s lets the dot match line breaks.

Unicode and sticky

u enables Unicode-aware parsing. y matches only at the current last-index position.

JavaScript, C#, Bash, UiPath, and Splunk regex compatibility

This online regex builder executes patterns with your browser's JavaScript engine. You can use its guided workflow to draft patterns for other platforms, but regex flavors and escaping rules differ. Always retest the exported pattern in the destination system before using it in production.

JavaScript and JS regex builder

Patterns and flags are executed directly in the browser, so the live results apply to JavaScript. The tool can also format the pattern as a JavaScript literal or JSON string.

C# and .NET regex builder compatibility

When using this as a C# online regex builder, remember that C# uses the .NET regex engine and string escaping depends on whether the value is a regular or verbatim string. Copy the pattern, adapt its escaping, and test it with System.Text.RegularExpressions.

UiPath regex builder guidance

UiPath commonly relies on .NET regular expressions. A pattern drafted here can be a starting point for a regex builder in UiPath, but .NET-specific syntax and UiPath activity settings must be verified there.

Bash regex builder guidance

Bash [[ value =~ pattern ]], grep, and sed do not all use the same regex rules. Check quoting, backslashes, character classes, and extended-regex options in the exact shell command.

Splunk regex builder guidance

Splunk search commands commonly use PCRE-compatible patterns rather than the browser's JavaScript flavor. Verify named groups, lookarounds, escaping, and field extraction behavior in Splunk.

Quick answers

Regex generator and tester FAQs

Important details about privacy, compatibility, performance, and validation.

Does this tool upload my regex or test text?

No. Generation, matching, highlighting, replacement, and explanations run locally in your browser.

Which regular expression flavor does this use?

The tool uses the JavaScript regular expression engine available in your browser. Syntax supported only by PCRE, Python, Java, or .NET may behave differently.

Why can a regular expression become slow?

Nested or ambiguous quantifiers can cause excessive backtracking. Keep patterns specific, avoid unnecessary nesting, and test long non-matching input.

What is the difference between validation and matching?

Validation checks whether the pattern is valid JavaScript regex syntax. Matching applies the valid pattern to your test text and reports the results.

Can I use this regex builder for C#, .NET, Bash, UiPath, or Splunk?

You can draft a pattern here, but this tool validates only JavaScript regex. C# and UiPath commonly use the .NET engine, Bash tools vary, and Splunk commonly uses PCRE-compatible syntax, so test the exported pattern in its destination before deployment.

Is this an AI regex builder?

No. The guided builder creates deterministic patterns from the URL or request choices you make. Generation and testing run locally in your browser, which keeps the process predictable and your sample data private.

What is regex?

Regex, short for regular expression, is a pattern language for finding, validating, extracting, splitting, or replacing text.

What is a regex pattern?

A regex pattern combines literal characters with operators that describe allowed text, positions, choices, groups, or repetitions.

How do you write and use regex?

Start with examples that should and should not match, keep fixed text literal, replace only variable parts with specific classes or groups, anchor the pattern when needed, and test it in the destination engine.

What is regex in Python?

Python provides regex through its re module. Use raw strings for patterns when possible, then call functions such as re.search, re.fullmatch, re.findall, or re.sub.

What is regex in JavaScript or JS?

JavaScript represents regex with a literal such as /pattern/i or a RegExp object. Common methods include test, match, matchAll, and replace. This page executes JavaScript regex directly.

What is regex in Java?

Java provides regular expressions through java.util.regex.Pattern and Matcher. Backslashes inside Java string literals usually need additional escaping.

How do you use regex in SQL?

Use the regex operator or function supported by your database. PostgreSQL, MySQL, Oracle, and other systems differ, so verify the exact syntax, flags, and replacement behavior in that database.

How do you pronounce regex?

Both “redge-ex” and “reg-ex” are widely understood. The term is an abbreviation of “regular expression.”

What does ? mean in regex?

After a token or group, ? usually means zero or one occurrence, making it optional. It also begins constructs such as non-capturing groups and lookarounds, so its exact meaning depends on context.

What does + mean in regex?

+ is a quantifier meaning one or more occurrences of the preceding token or group. Escape it as \+ when you need to match a literal plus sign.

What does ^ mean in regex?

Outside a character class, ^ usually anchors the match to the start of the input or line. At the beginning of a character class, it negates the class, as in [^0-9].

What is a word boundary in regex?

\b matches a position between a word character and a non-word character, or at the edge of the input. It has zero width, so it checks a position without consuming text.