I want to share through the previous article, you should already have an understanding of the purpose and usage of regular expressions. This article is regarded as an extended reading of regular expressions. I recommend a website that visualizes regular expressions so that readers can deepen their impression of regular expressions.
Not much nonsense, first go to the website: https://www.debuggex.com/ .
Then, through the URL, let's review the five types of metacharacters.
For example, [abc] means matching one of abc. The picture is One of.
[^abc] does not match abc.
* Means 0 or more, + means 1 or more,? Represents 0 or 1, I think you should be able to understand the following picture.
a|b stands for matching a or b, as shown in the figure.
For example (a)(b), two groups will be extracted.
Symbols with specific meanings will not be demonstrated here, and everyone can do more to deepen the impression.
I hope this tool can help you better understand and learn the application of regular expressions. Finally, regular expressions are really fragrant.