-
worldlooksblack has quit
2025-09-25 26846, 2025
-
worldlooksblack joined the channel
2025-09-25 26846, 2025
-
worldlooksblack has quit
2025-09-25 26846, 2025
-
worldlooksblack joined the channel
2025-09-25 26808, 2025
-
Maxr1998_ joined the channel
2025-09-25 26810, 2025
-
Maxr1998 has quit
2025-09-25 26844, 2025
-
SigHunter has quit
2025-09-25 26824, 2025
-
SigHunter joined the channel
2025-09-25 26825, 2025
-
SigHunter has quit
2025-09-25 26834, 2025
-
SigHunter joined the channel
2025-09-25 26826, 2025
-
wargreen_ has quit
2025-09-25 26839, 2025
-
reosarevok[m]
Argh, regexes. Halp?
2025-09-25 26817, 2025
-
reosarevok[m]
I currently have this in my parse date code
2025-09-25 26820, 2025
-
reosarevok[m]
const ymdRegex = /^\W*([0-9]{4})(?:\W+(0?[1-9]|1[0-2])(?:\W+(0?[1-9]|[12][0-9]|3[01]))?)?\W*$/;
2025-09-25 26837, 2025
-
reosarevok[m]
I wanted it to also support parsing ????-??-22 or whatnot
2025-09-25 26847, 2025
-
reosarevok[m]
So I thought I'd do
2025-09-25 26850, 2025
-
reosarevok[m]
^\W*([0-9]{4}|\?{4})(?:\W+(0?[1-9]|1[0-2]|\?{2})(?:\W+(0?[1-9]|[12][0-9]|3[01]|\?{2}))?)?\W*$
2025-09-25 26822, 2025
-
reosarevok[m]
But if matching that with 1999-??-09 it still gives me "match 1 1999, match 2 09" and skips the ?? entirely
2025-09-25 26827, 2025
-
reosarevok[m]
Am I being an idiot?
2025-09-25 26835, 2025
-
kellnerd[m]
2025-09-25 26830, 2025
-
kellnerd[m]
Ah, there is a path which allows "-??-" as a non-word seprator between year and "month".
2025-09-25 26812, 2025
-
kellnerd[m]
So you have to exclude "?" from "\W" or use a more specific separator pattern.
2025-09-25 26803, 2025
-
kellnerd[m]
* So you have to exclude "?" from "\\W" or use a more specific separator pattern reosarevok.
2025-09-25 26855, 2025
-
reosarevok[m]
Oh, thanks, I'll try that
2025-09-25 26810, 2025
-
mayhem has quit
2025-09-25 26838, 2025
-
irimi1 has quit
2025-09-25 26842, 2025
-
kilos_ has quit
2025-09-25 26845, 2025
-
kuno has quit
2025-09-25 26847, 2025
-
irimi1 joined the channel
2025-09-25 26850, 2025
-
RetroPunk has quit
2025-09-25 26854, 2025
-
kilos_ joined the channel
2025-09-25 26856, 2025
-
kuno joined the channel
2025-09-25 26859, 2025
-
alastairp has quit
2025-09-25 26804, 2025
-
rozlav82 has quit
2025-09-25 26804, 2025
-
mayhem joined the channel
2025-09-25 26810, 2025
-
alastairp joined the channel
2025-09-25 26830, 2025
-
ursa-major has quit
2025-09-25 26840, 2025
-
sbaildon has quit
2025-09-25 26847, 2025
-
nawcom has quit
2025-09-25 26805, 2025
-
nawcom joined the channel
2025-09-25 26823, 2025
-
sbaildon joined the channel
2025-09-25 26834, 2025
-
rozlav82 joined the channel
2025-09-25 26843, 2025
-
RetroPunk joined the channel
2025-09-25 26843, 2025
-
ursa-major joined the channel
2025-09-25 26841, 2025
-
SothoTalKer has quit
2025-09-25 26848, 2025
-
SothoTalKer joined the channel
2025-09-25 26803, 2025
-
kilos_ has quit
2025-09-25 26815, 2025
-
kilos_ joined the channel
2025-09-25 26839, 2025
-
rozlav82 has quit
2025-09-25 26848, 2025
-
FichteFoll has quit
2025-09-25 26811, 2025
-
rozlav82 joined the channel
2025-09-25 26827, 2025
-
FichteFoll joined the channel
2025-09-25 26855, 2025
-
monkey[m] joined the channel
2025-09-25 26856, 2025
-
monkey[m]
kellnerd: Do you have matrix set up to ping you every time the word "regex" appears? :D
2025-09-25 26845, 2025
-
SigHunter has quit
2025-09-25 26846, 2025
-
SigHunter joined the channel
2025-09-25 26824, 2025
-
kellnerd[m]
monkey: I only saw the message by chance. But I do receive pings for Harmony and a couple of other things.
2025-09-25 26840, 2025
-
reosarevok[m]
2025-09-25 26857, 2025
-
reosarevok[m]
That works better
2025-09-25 26811, 2025
-
reosarevok[m]
It works now with 1999-??-01
2025-09-25 26852, 2025
-
reosarevok[m]
But for some reason, it still doesn't work with just ????-01
2025-09-25 26804, 2025
-
reosarevok[m]
(it detects 01 as group 1)
2025-09-25 26850, 2025
-
reosarevok[m]
Can you see what is going wrong?
regexr.com does detect ???? as group 1 with the same regex 🫠
2025-09-25 26828, 2025
-
kellnerd[m]
Sorry, but I don't see why that shouldn't work. I'll test once I'm back at a computer.
2025-09-25 26832, 2025
-
kellnerd[m]
It's a JavaScript RegExp on the frontend, right?
2025-09-25 26827, 2025
-
lusciouslover has quit
2025-09-25 26829, 2025
-
reosarevok[m]
Yeah
2025-09-25 26840, 2025
-
reosarevok[m]
Maybe I'm doing something else that is dumb :)
2025-09-25 26851, 2025
-
lusciouslover joined the channel
2025-09-25 26831, 2025
-
reosarevok[m]
Your tool shows "3 times" instead of 4 btw, but that seems unrelated :)
2025-09-25 26811, 2025
-
kellnerd[m]
Oh, that's intended by the original author. The loop indicates the repetitions and not the total counts.
2025-09-25 26805, 2025
-
reosarevok[m]
Aah, ok
2025-09-25 26826, 2025
-
kellnerd[m]
But I agree it's a bit confusing when you are used to the regex notation.
2025-09-25 26842, 2025
-
reosarevok[m]
Hmm, funnily ????-01-01 works and detects the three parts
2025-09-25 26855, 2025
-
reosarevok[m]
????-01-?? also detects just 01 tho
2025-09-25 26809, 2025
-
reosarevok[m]
Ah, regexes, what's not to love
2025-09-25 26801, 2025
-
reosarevok[m]
Huh...
2025-09-25 26809, 2025
-
reosarevok[m]
????-1 works
2025-09-25 26817, 2025
-
reosarevok[m]
but ????-11 does not so it's not the optional 0 either
2025-09-25 26850, 2025
-
petitminion joined the channel
2025-09-25 26807, 2025
-
_BrainzGit
2025-09-25 26801, 2025
-
kellnerd[m]
2025-09-25 26849, 2025
-
kellnerd[m]
So whatever is breaking some of them is probably a different step, maybe some automatic input trimming etc?
2025-09-25 26812, 2025
-
reosarevok[m]
I guess. I'll check that, thanks
2025-09-25 26828, 2025
-
\- has quit
2025-09-25 26827, 2025
-
reosarevok[m]
2025-09-25 26809, 2025
-
reosarevok[m]
I guess the script in there would actually copy to the .po files all the translations, even the ones that we still do with l_mb_server
2025-09-25 26820, 2025
-
reosarevok[m]
* do with `l_mb_server, * l_mb_server`
2025-09-25 26806, 2025
-
reosarevok[m]
Any ideas on how to improve that? Or is it fine for now and the unused ones will be dropped later by the usual translation file processes?
2025-09-25 26849, 2025
-
zer0bitz- has quit
2025-09-25 26803, 2025
-
zer0bitz- joined the channel
2025-09-25 26820, 2025
-
worldlooksblack has quit
2025-09-25 26808, 2025
-
reosarevok[m]
In any case, using l_mb_server did get the strings off reports.pot so that's sweet
2025-09-25 26852, 2025
-
reosarevok[m]
For now pushed the relevant changes, need to test further tomorrow
2025-09-25 26801, 2025
-
petitminion has quit
2025-09-25 26835, 2025
-
petitminion joined the channel
2025-09-25 26815, 2025
-
petitminion has quit
2025-09-25 26847, 2025
-
petitminion joined the channel
2025-09-25 26827, 2025
-
petitminion has quit
2025-09-25 26830, 2025
-
mthax joined the channel
2025-09-25 26859, 2025
-
v6lur joined the channel
2025-09-25 26805, 2025
-
[Pokey] has quit
2025-09-25 26827, 2025
-
mthax has quit
2025-09-25 26847, 2025
-
mthax joined the channel
2025-09-25 26832, 2025
-
Pokey joined the channel
2025-09-25 26849, 2025
-
worldlooksblack joined the channel
2025-09-25 26819, 2025
-
mayhem has quit
2025-09-25 26831, 2025
-
mayhem joined the channel
2025-09-25 26804, 2025
-
\- joined the channel
2025-09-25 26853, 2025
-
_BrainzGit
2025-09-25 26849, 2025
-
zer0bitz-_ joined the channel