Đoạn mã sau sử dụng Python regex trích xuất id email từ chuỗi / văn bản đã cho
Ví dụ
import re s ='manogna@tutorialspoint.com56' result =re.findall('[a-zA-Z0-9]\S*@\S*[a-zA-Z]', s) print result
Đầu ra
Điều này cho kết quả
['manogna@tutorialspoint.com']