当前位置:网站首页>Notes - regular expressions
Notes - regular expressions
2022-07-03 10:13:00 【DadongDer】
What is regular expression ?
- A text mode
- Include normal characters + Special characters
- Operate on strings
Ordinary character : for example a To z Between the letters
Special characters : Metacharacters
Why use regular expressions ?
- Test the pattern within the string : data validation
- replace text : Recognize specific text with regularity , Delete the text completely or replace it with other text
- Extract substring
It has a wide range of applications
- C#
- Java
- JavaScript
- Python
- Ruby
and so on…
grammar
A regular expression component can be a single character 、 Character set 、 character in range 、 Choice between characters or any combination of all these components .
- Ordinary character
- Nonprinting characters
- Special characters :
To match these special characters , You must first make the characters " escape ", The backslash character \ Put it in front of them . - qualifiers :
By means of *、+ or ? Place after qualifier ?, The expression is from " greedy " The expression is converted to " Not greedy " Expression or minimum match . - Locator :
Cannot use qualifier with locator . - choice :
Parentheses enclose all options , Use... Between adjacent options | Separate .
Parenthesis side effects : Make the relevant match cached , Available at this time ?: Put the first option forward to eliminate this side effect . - backreferences :
The simplest way to reverse reference 、 One of the most useful applications , It provides the ability to find a match between two identical adjacent words in the text .
Grammar details - From the rookie tutorial
reference: Metacharacter list + describe
Operator priority
reference: priority + describe
Matching rules
Some very simple examples 1.0
Other examples 2.0
These contents are not difficult to read , The key is how to think and use it when it comes to actual use .
so…u know Rookies start with imitation …
边栏推荐
- CV learning notes convolutional neural network
- Pycharm cannot import custom package
- 20220604 Mathematics: square root of X
- 4.1 Temporal Differential of one step
- Anaconda installation package reported an error packagesnotfounderror: the following packages are not available from current channels:
- Replace the files under the folder with sed
- 波士顿房价预测(TensorFlow2.9实践)
- Markdown latex full quantifier and existential quantifier (for all, existential)
- QT setting suspension button
- is_ power_ of_ 2 judge whether it is a multiple of 2
猜你喜欢

Leetcode-513:找树的左下角值

CV learning notes - deep learning

What can I do to exit the current operation and confirm it twice?

CV learning notes - image filter

3.1 Monte Carlo Methods & case study: Blackjack of on-Policy Evaluation

CV learning notes - scale invariant feature transformation (SIFT)

Opencv notes 20 PCA

Octave instructions

CV learning notes - clustering

Vgg16 migration learning source code
随机推荐
Leetcode - 1670 design front, middle and rear queues (Design - two double ended queues)
使用密钥对的形式连接阿里云服务器
LeetCode - 460 LFU 缓存(设计 - 哈希表+双向链表 哈希表+平衡二叉树(TreeSet))*
20220602数学:Excel表列序号
MySQL root user needs sudo login
Yocto Technology Sharing Phase 4: Custom add package support
Circular queue related design and implementation reference 1
Leetcode - 895 maximum frequency stack (Design - hash table + priority queue hash table + stack)*
pycharm 无法引入自定义包
When the reference is assigned to auto
20220603 Mathematics: pow (x, n)
Leetcode - 933 number of recent requests
Deep learning by Pytorch
Opencv+dlib to change the face of Mona Lisa
Vgg16 migration learning source code
LeetCode - 715. Range module (TreeSet)*****
[C question set] of Ⅵ
[combinatorics] combinatorial existence theorem (three combinatorial existence theorems | finite poset decomposition theorem | Ramsey theorem | existence theorem of different representative systems |
Replace the files under the folder with sed
4G module IMEI of charging pile design