was looking through some of my old code golf solutions. "define a function `is_valid_HK_phone_number` and a function `has_valid_HK_phone_number` that verify if a string is or contains a correctly-formatted hong kong phone number" 

import re
f=lambda n:lambda s:bool((0,re.match,re.search)[n](r'\d{4} \d{4}$ '[:-n],s))
_='s_valid_HK_phone_number=f(';exec(f'i{_}1);ha{_}2)')
Follow

re: was looking through some of my old code golf solutions. "define a function `is_valid_HK_phone_number` and a function `has_valid_HK_phone_number` that verify if a string is or contains a correctly-formatted hong kong phone number" 

@monorail this is disgusting. Keep up the good work

re: was looking through some of my old code golf solutions. "define a function `is_valid_HK_phone_number` and a function `has_valid_HK_phone_number` that verify if a string is or contains a correctly-formatted hong kong phone number" 

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.