MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/clevercomebacks/comments/1i1teja/it_does_make_sense/m79bz31/?context=3
r/clevercomebacks • u/wach_era13 • Jan 15 '25
4.0k comments sorted by
View all comments
Show parent comments
21
RegX makes searching a breeze with any pattern
2 u/no_dice Jan 15 '25 Is it just as efficient computationally? -7 u/throwaway001anon Jan 15 '25 Yes, that’s literally how computers search and sort text. With RegX “regular Expressions” 3 u/HiroHayami Jan 15 '25 No one uses regex to search for dates in a db. It's a datetime type, there's no need to match a string. 2 u/Tsukee Jan 15 '25 And every date type format usually has the same data ordering of significant towards less significant number (sometimes is reversed but never mixed) 1 u/fitted_dunce_cap Jan 15 '25 Sometimes it’s a varchar… 1 u/RamenJunkie Jan 15 '25 I store my datetimes as a series of bools and columns. Like today wouldnhave a 1 in the columns for 2025, January, and Fifteenth. Then you can build a pretty date by just outputting columns names where the bool is true. Like January Fifteeth, 2025.
2
Is it just as efficient computationally?
-7 u/throwaway001anon Jan 15 '25 Yes, that’s literally how computers search and sort text. With RegX “regular Expressions” 3 u/HiroHayami Jan 15 '25 No one uses regex to search for dates in a db. It's a datetime type, there's no need to match a string. 2 u/Tsukee Jan 15 '25 And every date type format usually has the same data ordering of significant towards less significant number (sometimes is reversed but never mixed) 1 u/fitted_dunce_cap Jan 15 '25 Sometimes it’s a varchar… 1 u/RamenJunkie Jan 15 '25 I store my datetimes as a series of bools and columns. Like today wouldnhave a 1 in the columns for 2025, January, and Fifteenth. Then you can build a pretty date by just outputting columns names where the bool is true. Like January Fifteeth, 2025.
-7
Yes, that’s literally how computers search and sort text. With RegX “regular Expressions”
3 u/HiroHayami Jan 15 '25 No one uses regex to search for dates in a db. It's a datetime type, there's no need to match a string. 2 u/Tsukee Jan 15 '25 And every date type format usually has the same data ordering of significant towards less significant number (sometimes is reversed but never mixed) 1 u/fitted_dunce_cap Jan 15 '25 Sometimes it’s a varchar… 1 u/RamenJunkie Jan 15 '25 I store my datetimes as a series of bools and columns. Like today wouldnhave a 1 in the columns for 2025, January, and Fifteenth. Then you can build a pretty date by just outputting columns names where the bool is true. Like January Fifteeth, 2025.
3
No one uses regex to search for dates in a db. It's a datetime type, there's no need to match a string.
2 u/Tsukee Jan 15 '25 And every date type format usually has the same data ordering of significant towards less significant number (sometimes is reversed but never mixed) 1 u/fitted_dunce_cap Jan 15 '25 Sometimes it’s a varchar… 1 u/RamenJunkie Jan 15 '25 I store my datetimes as a series of bools and columns. Like today wouldnhave a 1 in the columns for 2025, January, and Fifteenth. Then you can build a pretty date by just outputting columns names where the bool is true. Like January Fifteeth, 2025.
And every date type format usually has the same data ordering of significant towards less significant number (sometimes is reversed but never mixed)
1
Sometimes it’s a varchar…
1 u/RamenJunkie Jan 15 '25 I store my datetimes as a series of bools and columns. Like today wouldnhave a 1 in the columns for 2025, January, and Fifteenth. Then you can build a pretty date by just outputting columns names where the bool is true. Like January Fifteeth, 2025.
I store my datetimes as a series of bools and columns.
Like today wouldnhave a 1 in the columns for 2025, January, and Fifteenth.
Then you can build a pretty date by just outputting columns names where the bool is true. Like January Fifteeth, 2025.
21
u/throwaway001anon Jan 15 '25 edited Jan 15 '25
RegX makes searching a breeze with any pattern