Regular Expressions 101

Community Patterns

Whatsapp Chat Regex

0

Regular Expression
Python

r"
(^[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,2}), ([0-9]{1,2}:[0-9]{1,2} [a-zA-Z]{2}) - ([a-z0-9 \S]+?)(:| added|created group) ([a-z0-9 \S\n]+)?
"

Description

This is a Regex to the Whatsapp chat data. This parses the G1 - Date, G2 - Time, G3 - User, G4 - Qualifier & G5 - Actual chat data.

The Qualifier (G4) identifies the group Creation information, : that separates the User and Ping chat data and New user added chats.

Submitted by Vinodh Sukumaran - 8 years ago