current location: Home > Download > Learning resources > Web page production > Regular quick start + commonly used expressions
Regular quick start + commonly used expressions
Classify: Learning materials / Web page production | Release time: 2018-01-20 | visits: 2949218 |
Download: 166 |
Latest Downloads
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
The most powerful brain 3
Odd Dust: Damila
Young Journey to the West 2
24 HoursReading Leaderboard
- 1 How to Extend and Override Django Admin Templates Without Replacing Them?
- 2 How to Combine Two Arrays in JavaScript?
- 3 dynexwcui.exe - What is dynexwcui.exe?
- 4 How to Override Styles in a Shadow-Root Element?
- 5 How to Create a Dynamic Pivot Table in MySQL with Integer User IDs?
- 6 dtvimpex.dll - What is dtvimpex.dll?
- 7 Why does "go module @latest found but does not contain package" Error Occur When Using github.com/mkideal/cli?
- 8 Why Do Lambda Expressions Sometimes Fail to Pass the Correct Parameters When Connecting Slots in PyQt?
- 9 How to Dynamically Create CSS @-keyframes Animations Based on Server Responses?
- 10 How to Select a Label with a Specific 'for' Attribute in CSS?
- 11 Why Can't I Assign to a Struct Field in a Map?
- 12 How to Retrieve the Value of a Submitted Button in a Form with Multiple Buttons?
- 13 When Should You Use Getters/Setters Instead of Public Data Members?
- 14 Who is Running My PHP Script?
- 15 Why Am I Getting "SMTP Error: Could Not Authenticate" When Sending Emails with PHPMailer?
Latest Tutorials
-
- Go language practical GraphQL
- 2009 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 3428 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 1810 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2623 2024-03-29
First, let’s briefly introduce regular expressions:
When writing programs or web pages that process strings, there is often a need to find strings that match certain complex rules. Regular expressions are tools used to describe these rules. In other words, regular expressions are codes that record text rules.
Let’s take a look at what the messy characters in regular expressions mean:
1. Commonly used metacharacters
. Matches any character except newlines
\w matches letters or numbers or underscores or Chinese characters
\s matches any whitespace character
\d matches digits
\b matches the beginning or end of a word
^ Matches the beginning of a string
$ Matches the end of the string
Then let’s try to understand:
\bhello\b actually searches for the word hello - first the beginning of a word (\b), then the string hello, and finally the end of the word (\b).
010-\d\d\d\d\d\d\d\d For example, Beijing's landline phone number - first 010-, then 8 digits (\d).
^\d{18}$ For example, the ID number - first the string starts (^), then the 18-digit number (\d), and finally the string ends ($).