Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
(\d{2}\/\d{2}\/\d{4}),\s(\d(?:\d)?:\d{2})\s-\s([^:]*):\s(.*?)(?=\s*\d{2}\/|\$)
"
gims

Description

This Regex parse whats-app messages to 4 groups: Group1- Date (dd/mm/yyyy) Group2- Time (hh:mm) Group3- Author/Sender (name or phone number) Group4- Chat (actual chat data)

Submitted by anonymous - 5 years ago