print(re.sub('\d{4}', 'XXXX', '010-1234-5678'))

결과

010-XXXX-XXXX

+ Recent posts