Regex Tester & Validator

Regex Tester & Validator

Summary

A Regex Tester & Validator is a valuable tool for testers, developers, and anyone working with data validation, pattern matching, or text processing.

Use Case Regex Pattern Explanation
GeneralValidate Email ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ Validates email format (e.g., user@example.com)
GeneralPhone Number (US) \d{3}-\d{3}-\d{4} Matches phone numbers in XXX-XXX-XXXX format
CucumberScenario Outline ^Scenario Outline: (.*)$ Matches Cucumber scenario outline declarations
CucumberGiven Step ^Given (?:|I )(.+)$ Matches Cucumber Given steps with optional “I” subject
CucumberThen Step with Table ^Then (?:|I )should see table:$ Matches Cucumber Then steps expecting a data table
SeleniumDynamic ID Elements //*[contains(@id, 'dynamic-')] Locates elements with dynamic IDs containing ‘dynamic-‘
SeleniumData-Test Attributes //[data-test-id='([^']*?)'] Matches elements with data-test-id attributes
SeleniumAngular Dynamic Elements //*[@ng-repeat='item in items'] Locates Angular repeated elements
TestNGTest Method Pattern @Test\s*(\(.*\))?\s*public\s+void\s+\w+\s*\([^)]*\) Matches TestNG test method declarations
TestNGData Provider @DataProvider\s*\(\s*name\s*=\s*"([^"]+)"\s*\) Matches TestNG data provider declarations
APIJWT Token ^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$ Validates JWT token format
APIBearer Token Header ^Bearer\s+[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$ Matches Authorization header with Bearer token
APIREST API Endpoint ^/api/v\d+/[\w-]+(?:/[\w-]+)*$ Matches RESTful API endpoints with versioning
Pattern copied to clipboard!
How To Use Regex – Tutorial