TestDino

Free Tools / Playwright Regex Tester

Playwright Regex Tester

Test regex patterns against real text and get a Playwright-ready snippet for getByText, getByRole, waitForURL, filter hasText, or page.route.

Pattern and test string

Type a pattern, pick flags, paste text. Results update as you type.

Live

Flags

Match result

1 match
1

Highlighted below. Use this expression directly in Playwright.

Highlighted matches

Click Sign In to continue
Already signed up?

Playwright snippet

Drop this directly into your test. Updates with your pattern and flags.

typescript
await page.getByText(/sign (in|up)/i).click();

How this works?

How the tester validates patterns and generates Playwright-ready code.

Write your pattern

Type a regex pattern and choose flags. The tester validates the expression immediately and shows an error if the syntax is broken.

Run against your test string

Paste the text your Playwright locator will see. Matches highlight inline so you can confirm the pattern captures exactly what you expect.

Pick the Playwright context

Select the API you plan to use: getByText, getByRole name, waitForURL, filter hasText, or page.route. The snippet updates to match.

Copy the ready snippet

The generated code uses correct regex literal syntax for Playwright. Copy it straight into your test file without any manual formatting.

FAQs

Playwright's getByText uses an exact string match unless you pass { exact: false } or a regex. A regex like /sign in/ will match any element containing that substring, giving you the partial behavior you need.