Skip to content

Instantly share code, notes, and snippets.

View moinologics's full-sized avatar
🏠
Working from home

Moin Ahmad moinologics

🏠
Working from home
View GitHub Profile
syntax reference - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range#syntax
^bytes=(([0-9]{1,}-[0-9]*)|([0-9]*-[0-9]{1,}))(, (([0-9]{1,}-[0-9]*)|([0-9]*-[0-9]{1,})))*$
@moinologics
moinologics / parse_whatsapp_exported_chat.py
Created January 26, 2025 12:26
parse WhatsApp exported chat
import re
datetime_pattern = r'\d{2}/\d{2}/\d{2}, \d{1,2}:\d{2}\s?[ap]m'
name_pattern = r'[A-Za-z ]*'
message_pattern = r'.*'
pattern = re.compile(f'({datetime_pattern}) - ({name_pattern}): ({message_pattern})')
def get_chats(path):
with open(path, 'r') as f: