The regular expression testing tool provides you with JS regular expression verification, regular expression verification, regular expression verification, regular expression testing tools, which can be used to customize regular expressions to extract text content, validate arbitrary regular expressions, extract URLs from regular expressions, and format regular expressions online. I hope it will be helpful to everyone.
The role of regular expressions
A 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 syntactic rule. Regular expressions are cumbersome, but they are powerful. After learning them, they will give you an absolute sense of achievement in addition to improving efficiency. Many programming languages support string operations using regular expressions.
อักขระเมทาคาราคเตอร์ทั่วไป
รหัส | explain |
---|---|
. | ตรงอักขระทุกตัวเว้นจากตัวอักษรสาระ |
\w | ตรงอักษรหรือตัวเลขหรืออักขระต่อรอง |
\s | ตรงช่องว่าง |
\d | ตรงตัวเลข |
\b | ตรงที่เริ่มต้นหรือจบของคำ |
^ | ตรงที่ตรงของคำที่ตรงของ |
$ | ตรงท้ายของคำ |
คำนำหน้าทั่วไป
Code/Syntax | explain |
---|---|
* | ซ้ำหรือมากกว่า ครั้งเรียกซ้ำ |
+ | 1 หรือมากกว่า ครั้งเรียกซ้ำ |
? | ซ้ำหรือเรียกซ้ำเดียว |
{n} | n ครั้งเรียกซ้ำ |
{n,} | n หรือมากกว่า ครั้งเรียกซ้ำ |
{n,m} | n ถึง m ครั้งเรียกซ้ำ |
common antonym
Code/Syntax | explain |
---|---|
\W | Matches any character that is not a letter, number, underscore, or kanji |
\S | Matches any character that is not a whitespace character |
\D | Matches any non-numeric characters |
\B | Match is not where words begin or end |
[^x] | Matches any character except x |
[^aeiou] | Matches any character except the letters aeiou |
character | describe |
---|---|
^\d+$ | Match non-negative integers (positive integers + 0) |
//Matches the integer ^\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 of 26 English letters |
^[A-Z]+$ | Matches a string of 26 English letters |
^[a-z]+$ | Matches a string of 26 lowercase letters |
^[A-Za-z0-9]+$ | Match a string of numbers and 26 letters |
^\w+$ | Matches a string consisting 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] | সাধারণ বিন্যাস চীনা অক্ষর ম্যাচ |
[^\x00-\xff] | ডবল ম্যাচ-বাইট অক্ষর (চীনা অক্ষর সহ) |
\n[\s| ]*\r | সাধারণ বিন্যাস শুক্ষা লাইন ম্যাচ |
/<(.*)>.*<\/>|<(.*)\/>/ | সাধারণ বিন্যাস এইচটিএমএল ট্যাগ ম্যাচ |
(^\s*)|(\s*$) | শেষ ম্যাচ সাধারণ বিন্যাস-to-শেষ স্পেস |
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* | সাধারণ বিন্যাস এমেইল এড্রেস ম্যাচ |
^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$ | সাধারণ বিন্যাস ম্যাচ ইউআরএল |
^[a-zA-Z][a-zA-Z0-9_]{4,15}$ | অ্যাকাউন্টটি কি বৈধ নির্ধারণ (অক্ষরের সাথে শুরু, অপরিবর্তনীয়) 5-16 বাইট, অক্ষরসংখ্যা এবং আনালফানিক আন্ডারস্কোর) |
(\d{3}-|\d{4}-)?(\d{8}|\d{7})? | অভ্যন্তরীণ ফোন নম্বরটি ম্যাচ |
^[1-9]*[1-9][0-9]*$ | Tencent QQ নম্বরটি ম্যাচ |