Found an error immediately "Any lowercase character" doesn't match all Swedish lowercase characters.
Regex Isn't Hard (2023)
11–20 of 109 posts
Re: Regex Isn't Hard (2023)
#12Found an error immediately "Any lowercase character" doesn't match all Swedish lowercase characters.
Ok. This sounds like an interesting detour. Can you elaborate on that one? I doubt I will ever use that knowledge, but it sounds like it is worth knowing anyway.
Re: Regex Isn't Hard (2023)
#13Found an error immediately "Any lowercase character" doesn't match all Swedish lowercase characters.
Re: Regex Isn't Hard (2023)
#14Re: Regex Isn't Hard (2023)
#15> e.g. This pattern ([0-9][0-9]?[0-9]][.])+ matches one, two or three digits followed by a . and also matches repeated patterns of this. This wold match an IP address (albeit not strictly). I love regular expressions but one thing I've learned over the years is the syntax is dense enough that even people who are confident enough to start writing regex tutorials often can't write a regex that matches an IP address.
edit: asking partly, because in my current work I occassionally have to convince non-technical users to use one type of entry over other. For that reason, easy to read, simple regex wins over fancy, but convoluted regex.
Re: Regex Isn't Hard (2023)
#16I mean sure, if it was my full-time job to write regexes I’d probably get pretty good at it. But instead a really complex one comes up maybe once a year for me and so I have to go to some online regex checker and start iteratively building one up, spending hours only find some condition where it doesn’t work and back to the checker... So I don’t think it’s easy, but I do agree that they are very useful.
Re: Regex Isn't Hard (2023)
#17This is truly one thing AI solved. Hard to write, easy to test. No one needs to learn this convoluted syntax in the future and we're all better for it.
Re: Regex Isn't Hard (2023)
#18I strongly agree with [^"] etc. over . and .? Involves much less thinking!
Re: Regex Isn't Hard (2023)
#19Nothing is hard once you've learned to do it intuitively. The hardest part is remembering how you struggled with it when you started.
Re: Regex Isn't Hard (2023)
#20 This pattern ([0-9][0-9]?[0-9]][.])+ matches one, two or three digits followed by a . and also matches repeated patterns of this. This wold match an IP address (albeit not strictly).
that pattern (once you fixed the typo) would not match a whole ip address unless you allowed it to also swallow the character after the last octet, which wouldn't work at, say, end of line