Skip to content

Latest commit

 

History

History
53 lines (45 loc) · 2.47 KB

scrub_dates.md

File metadata and controls

53 lines (45 loc) · 2.47 KB

How to scrub dates

Contents

How to do it

The easiest way to scrub a date is by calling

verify(
    "created at 03:14:15",
    options=Options().with_scrubber(DateScrubber.get_scrubber_for("00:00:00")),
)

snippet source | anchor

which will produce

created at <date0>

snippet source | anchor

Supported formats

Example Date Regex Pattern
Tue May 13 16:30:00 [a-zA-Z]{3} [a-zA-Z]{3} \d{2} \d{2}:\d{2}:\d{2}
Wed Nov 17 22:28:33 EET 2021 [a-zA-Z]{3} [a-zA-Z]{3} \d{2} \d{2}:\d{2}:\d{2} [a-zA-Z]{3,4} \d{4}
Tue May 13 2014 23:30:00.789 [a-zA-Z]{3} [a-zA-Z]{3} \d{2} \d{4} \d{2}:\d{2}:\d{2}.\d{3}
Tue May 13 16:30:00 -0800 2014 [a-zA-Z]{3} [a-zA-Z]{3} \d{2} \d{2}:\d{2}:\d{2} -\d{4} \d{4}
13 May 2014 23:50:49,999 \d{2} [a-zA-Z]{3} \d{4} \d{2}:\d{2}:\d{2},\d{3}
May 13, 2014 11:30:00 PM PST [a-zA-Z]{3} \d{2}, \d{4} \d{2}:\d{2}:\d{2} [a-zA-Z]{2} [a-zA-Z]{3}
23:30:00 \d{2}:\d{2}:\d{2}
2014/05/13 16:30:59.786 \d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}.\d{2}\d
2020-9-10T08:07Z \d{4}-\d{1,2}-\d{1,2}T\d{1,2}:\d{2}Z
2020-09-10T08:07:89Z \d{4}-\d{1,2}-\d{1,2}T\d{1,2}:\d{2}:\d{2}Z
2020-09-10T01:23:45.678Z \d{4}-\d{1,2}-\d{1,2}T\d{1,2}:\d{2}:\d{2}.\d{3}Z
2023-07-16 17:39:03.293919 \d{4}-\d{1,2}-\d{1,2}(?:T
20210505T091112Z \d{8}T\d{6}Z
Tue May 13 16:30:00 2014 (Mon
2021-09-10T08:07:00+03:00 \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}+\d{2}:\d{2}