Regular expression testing tool provides you with js regular expression verification, regular expression verification, regular expression verification, regular expression testing tool, online custom regular expression extraction text content, any regular expression verification, regular expression extraction website, regular expression online formatting, etc., hoping to be helpful to everyone.
The role of regular expressions
A regular expression (Regular Expression) is a text pattern that includes ordinary characters (for example, letters between a and z) and special characters (called metacharacters). A regular expression uses a single string to describe and match a series of strings that match a certain syntactic rule. Regular expressions are cumbersome, but they are powerful. After learning, the application will give you an absolute sense of accomplishment in addition to improving efficiency. Many programming languages support the use of regular expressions for string operations.
Common Metacharacters| Code | Description |
|---|---|
| . | Match any character except line breaks |
| \w | Match letters or numbers or underscores |
| \s | Match any blank character |
| \d | Matching Numbers |
| \b | Matches the beginning or end of a word |
| ^ | Start of match string |
| $ | End of the matched string |
Common Qualifiers| Code/Syntax | Description |
|---|---|
| * | 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/Syntax | Description |
|---|---|
| \W | Matches any character that is not a letter, digit, underscore, or Chinese character. |
| \S | matches any character that is not a blank character |
| \D | Matches any non-numeric character |
| \B | Match is not where the word begins or ends |
| [^x] | Matches any character except x |
| [^aeiou] | Match any character except aeiou |
| Character | Description |
|---|---|
| ^\d+$ | // match non-negative integer (positive integer 0) |
| // match integer ^\d (\.\d )?$ | // match non-negative floating point number (positive floating point number 0) |
| ^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$ | // matches positive floating point numbers |
| ^((-\d+(\.\d+)?)|(0+(\.0+)?))$ | // match non-positive floating point number (negative floating point number 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 number |
| ^[A-Za-z]+$????????? | // matches a string of 26 English letters |
| ^[A-Z]+$ ??? | // matches a string consisting of 26 uppercase letters |
| ^[a-z]+$ | // matches a lowercase string of 26 English letters |
| ^[A-Za-z0-9]+$ | // matches a string of numbers and 26 letters |
| ^\w+$ | // matches a string of numbers, 26 letters, or underscores |
| ^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$ | // match email address |
| ^[a-zA-z] :// match (\w (-\w )*)(\.(\w (-\w )*))*(\?\ S *)?$ | // match url |
| [\u4e00-\u9fa5] | Regular expressions that match Chinese characters |
| [^\x00-\xff] | Match double-byte characters (including Chinese characters) |
| \n[\s| ]*\r | Regular expression that matches a blank line |
| /<(.*)>.*<\/>|<(.*)\/>/ | Regular expressions that match HTML tags |
| (^\s*)|(\s*$) | Regular expressions that match leading and trailing spaces |
| \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* | Regular Expression for Matching Email Addresses |
| ^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$ | Regular expression that matches a web address URL |
| ^[a-zA-Z][a-zA-Z0-9_]{4,15}$ | Whether the matching account number is legal (letter beginning, 5-16 bytes allowed, alphanumeric underscores allowed) |
| (\d{3}-|\d{4}-)?(\d{8}|\d{7})? | Match domestic phone number |
| ^[1-9]*[1-9][0-9]*$ | Match Tencent QQ |
Friend Links:iCMS