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.
More free tools for Playwright teams
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.
