Regex Tester and generator helps you to test your Regular Expression and generate regex code for JavaScript PHP Go JAVA Ruby and Python.
^[0-9]*$
^\d{n}$^\d{n,}$^\d{m,n}$^(0|[1-9][0-9]*)$
^([1-9][0-9]*)+(.[0-9]{1,2})?$^(\-)?\d+(\.\d{1,2})?$^(\-|\+)?\d+(\.\d+)?$
^[0-9]+(.[0-9]{2})?$^[0-9]+(.[0-9]{1,3})?$^[1-9]\d*$ or ^([1-9][0-9]*){1,3}$ or ^\+?[1-9][0-9]*$^\-[1-9][]0-9"*$ or ^-[1-9]\d*$
^\d+$ or ^[1-9]\d*|0$
^-[1-9]\d*|0$ or ^((-\d+)|(0+))$
^\d+(\.\d+)?$ or ^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$
^((-\d+(\.\d+)?)|(0+(\.0+)?))$ or ^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$ or ^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$
^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$ or ^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$
^(-?\d+)(\.\d+)?$ or ^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$
^[A-Za-z0-9]+$ or ^[A-Za-z0-9]{4,40}$^.{3,20}$^[A-Za-z]+$
^[A-Z]+$
^[a-z]+$
^[A-Za-z0-9]+$
^\w+$ or ^\w{3,20}$[^%&',;=?$\x22]+
[^~\x22]+
^[a-zA-Z0-9_.+-][email protected][a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$
^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
^(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)?[0-9]{2}$^(0?[1-9]|1[0-2])$
^(0[1-9]|[12][0-9]|3[01])$
^.*(?=.{6,})(?=.*d)(?=.*[A-Z])(?=.*[a-z])(?=.*[[email protected]#$%^&*? ]).*$\b\d{3}[-.]?\d{3}[-.]?\d{4}\b^[0-9]{5}(?:-[0-9]{4})?$^[a-z0-9-]+$
/[\-\[\]\/\\\{\}\(\)\*\+\?\.\^\$\|]/^([a-zA-Z]+-?)+[a-zA-Z0-9]+\\.[x|X][m|M][l|L]$
[\u4e00-\u9fa5]
[^\x00-\xff]
\n\s*\r (be used to delete blank lines)
<(\S*?)[^>]*>.*?|<.*? />
^\s*|\s*$ or (^\s*)|(\s*$)
((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))A Regex (Regular Expression) Tester and Generator is a tool that allows you to write, test, and debug regular expressions, or automatically generate regex patterns based on text patterns or rules. Regular expressions are powerful search patterns used for matching, validating, extracting, or replacing text.
Instant Feedback: Quickly see how your regex pattern matches input data.
Error Detection: Helps identify syntax errors or unintended matches.
Pattern Building: Automates the creation of complex expressions, saving time and reducing mistakes.
Learning Tool: Helps beginners understand how regex works through live examples and explanations.
Regex Tester:
Input your regex pattern.
Enter test strings to see what matches.
View match highlights and capture groups.
Regex Generator:
Provide sample text or describe a pattern (e.g., "email addresses" or "dates").
Let the tool generate a corresponding regex.
Optionally customize or refine the generated pattern.
When validating form input (e.g., email, phone number, postal code).
When extracting specific data from logs, documents, or code.
When replacing or formatting strings using text editors, scripts, or code.
When learning or debugging regex patterns for use in programming, automation, or text processing.