current location: Home > Download > Learning resources > Web page production > Detailed explanation of python-regular re module
![Detailed explanation of python-regular re module](https://img.php.cn/upload/webcode/000/000/000/5a587a65acc64104.png)
Detailed explanation of python-regular re module
Classify: Learning materials / Web page production | Release time: 2018-01-12 | visits: 2982904 |
Download: 204 |
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 What are the Dogecoin purchasing apps? The top ten regular Dogecoin purchase mobile apps
- 2 Dogecoin Trading App Download and Installation Tutorial
- 3 购买狗狗币的正规平台2025最新排行榜
- 4 Virtual currency exchange list 2025
- 5 How to register and install Ouyi virtual currency trading platform? Learn about the coin circle in one article
- 6 Virtual currency trading software 2025 list
- 7 Ranking of the latest top ten exchanges in the currency circle (the latest ranking in 2025)
- 8 How to buy and trade virtual currency? Top 10 virtual currency trading exchanges in the currency circle
- 9 Which u-coin software is the best? Top 10 U-coin trading software 2025 stock
- 10 Where can I buy U coins safe? Top 10 Most Reliable U-Coin Purchase Platforms
- 11 Top 10 virtual currency trading apps global rankings 2025 update
- 12 What platform is binance? What does binance do? What is the use of binance?
- 13 What platform is gate.io? What does gate.io do? What is the use of gate.io?
- 14 Top 10 rankings of global currency trading platform apps in 2025
- 15 gate.io web version login address gateio trading platform web version entrance
Latest Tutorials
-
- Go language practical GraphQL
- 2745 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 4122 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 2219 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2981 2024-03-29
The function prototype of re.sub is: re.sub(pattern, repl, string, count)
The second function is the replaced string; in this case it is '-'
The fourth parameter refers to the number of replacements. Defaults to 0, meaning every match is replaced.
re.sub also allows sophisticated handling of replacement of matches using functions. For example: re.sub(r'\s', lambda m: '[' m.group(0) ']', text, 0); Replace the space ' ' in the string with '[ ]'.
re.split
You can use re.split to split a string, such as: re.split(r'\s ', text); split the string into a word list by spaces.
re.findall
re.findall can get all matching strings in the string. For example: re.findall(r'\w*oo\w*', text); Get all words containing 'oo' in the string.
re.compile
Regular expressions can be compiled into a regular expression object. Frequently used regular expressions can be compiled into regular expression objects, which can improve certain efficiency.
![](/static/newDowns/images/images/book.png)