blueloveTH d513a3b459 ...
2023-04-23 12:42:42 +08:00

22 lines
529 B
Markdown

---
icon: package
label: re
---
### `re.match(pattern, string)`
Return a match object if the string matches the pattern, and `None` otherwise. (force match at the beginning of the string)
### `re.search(pattern, string)`
Return a match object if the string matches the pattern, and `None` otherwise.
### `re.split(pattern, string)`
Split the string by the occurrences of the pattern.
### `re.sub(pattern, repl, string)`
Return a copy of the string with all occurrences of the pattern replaced by the replacement string.