Introduction to regular expression testing tools

Regular expression testing tools provide you with js regular expression verification, regular expression verification, regular expression verification, and regular expression testing tools. You can customize regular expressions online to extract text content and verify any regular expressions. , regular expression extraction URL, regular expression online formatting, etc. I hope it will be helpful to everyone.


The role of regular expressions

Regular expression (Regular Expression) is a text pattern that includes ordinary characters (for example, letters between a and z) and special characters (called "metacharacters"). Regular expressions use a single string to describe and match a series of strings that match a certain syntax rule. Regular expressions are cumbersome, but they are powerful. The application after learning them will not only improve your efficiency, but also give you an absolute sense of accomplishment. Many programming languages ​​support the use of regular expressions for string operations.

Commonly used metacharacters
codeillustrate
.Matches any character except newlines
\wMatch letters or numbers or underscores
\sMatches any whitespace character
\dMatch numbers
\bMatch the beginning or end of a word
^Matches the beginning of a string
$Match the end of the string
Common qualifiers
code/syntaxillustrate
*Repeat zero or more times
+Repeat one or more times
?Repeat zero or one time
{n}Repeat n times
{n,}Repeat n or more times
{n,m}Repeat n to m times
Commonly used antonyms
code/syntaxillustrate
\WMatches any character that is not letters, numbers, underscores, or Chinese characters
\SMatches any character that is not whitespace
\DMatches any non-digit character
\BMatch is not at the beginning or end of the word
[^x]Matches any character except x
[^aeiou]Matches any character except aeiou.

Regular expression reference

characterdescribe
^\d+$//Match non-negative integers (positive integers + 0)
//Match integers^\d+(\.\d+)?$//Match non-negative floating point numbers (positive floating point numbers + 0)
^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$//Match positive floating point numbers
^((-\d+(\.\d+)?)|(0+(\.0+)?))$//Match non-positive floating point numbers (negative floating point numbers + 0)
^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$//Match negative floating point numbers
^(-?\d+)(\.\d+)?$//Match floating point numbers
^[A-Za-z]+$?????????//Match a string consisting of 26 English letters
^[A-Z]+$ ???//Match a string consisting of 26 uppercase English letters
^[a-z]+$//Match a string consisting of 26 lowercase English letters
^[A-Za-z0-9]+$//Match a string consisting of numbers and 26 English letters
^\w+$//Match a string consisting of numbers, 26 English letters, or underscores
^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$//Match email address
^[a-zA-z]+:// match(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$//match url
[\u4e00-\u9fa5]Regular expression to match Chinese characters
[^\x00-\xff]Match double-byte characters (including Chinese characters)
\n[\s| ]*\rRegular expression to match empty lines
/<(.*)>.*<\/>|<(.*)\/>/Regular expression to match HTML tags
(^\s*)|(\s*$)Regular expression matching leading and trailing spaces
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*Regular expression to match email addresses
^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$Regular expression to match URL
^[a-zA-Z][a-zA-Z0-9_]{4,15}$Whether the matching account is legal (starting with a letter, 5-16 bytes allowed, alphanumeric underscores allowed)
(\d{3}-|\d{4}-)?(\d{8}|\d{7})?Match domestic phone numbers
^[1-9]*[1-9][0-9]*$Match Tencent QQ number
Language: English | 中文 | Русский | Español | Português | हिन्दी | தமிழ் | Deutsch | Français | عربي | 日本語 | 한국어
Your track:
Advertising area 1