current location: Home > Download > Learning resources > Web page production > How to write regular expressions
How to write regular expressions
Classify: Learning materials / Web page production | Release time: 2018-01-19 | visits: 2953481 |
Download: 164 |
Latest Downloads
Red Alert Online
Delta Force
Pokémon UNITE
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
24 HoursReading Leaderboard
- 1 How Can I Programmatically Access and Change Non-Inline CSS Values Using JavaScript?
- 2 Mocking with Jest and typescript - a cheatsheet
- 3 Can JavaScript Mimic PHP's Variable Variables?
- 4 Are PHP Global Variables Good or Bad Practice?
- 5 How to Display an Unordered List in Two Columns Across Modern and Legacy Browsers?
- 6 Async Local Storage is Here to Help You
- 7 How Can I Implement Delays in JavaScript Loops to Prevent Overlapping Iterations?
- 8 Can Calling Class Methods with Null Pointers in C Lead to Unexpected Behavior?
- 9 How Can Forward Declarations Solve Circular #include Problems?
- 10 `typename` vs. `class` in C Templates: When Do They Differ?
- 11 Building Composable Platforms with Harmony
- 12 How Can I Effectively Filter Profanity While Avoiding Circumvention Techniques?
- 13 VARCHAR(3000) or TEXT in MySQL: Which is Best for Storing 3000-Character User Messages?
- 14 How Can I Create Corner-Only Borders in CSS?
- 15 What Makes an Object Callable in Object-Oriented Programming?
Latest Tutorials
-
- Go language practical GraphQL
- 2330 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 3747 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 2000 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2782 2024-03-29
In literal mode, all the contents wrapped between // are metacharacters, some have special meanings, and most of them are ordinary metacharacters that represent their own meaning
varname ='wo';
varreg = /^\d " name "\d $/
In order to solve the above-mentioned need to add a variable to the regular expression, we can only use the instance creation method
varreg =newRegExp("^\\d " name "\\d $","g")
What is the difference between literal method and instance creation method in regular expressions?
1. Everything that appears in the literal method is metacharacters, so variable values cannot be spliced, but the instance creation method is possible.
2. Just write \d directly in the literal, but in the example it needs to be translated as \\d