Các hàm RegEx trong Python
Các chức năng của RegEx
Mô re
-đun cung cấp một tập hợp các chức năng cho phép chúng tôi tìm kiếm một chuỗi để tìm một kết quả phù hợp:
Function | Description |
---|---|
findall | Returns a list containing all matches |
search | Returns a Match object if there is a match anywhere in the string |
split | Returns a list where the string has been split at each match |
sub | Replaces one or many matches with a string |