3 ms·
Yeah the Pomsky one is already way better because you can easily see that &# are literal characters, not some weird regex thing you've forgotten about. That's
by IshKebab 4y ago
Yeah the Pomsky one is already way better because you can easily see that &# are literal characters, not some weird regex thing you've forgotten about.
That's one of the biggest issues with regex - mixing up data and control.
But I would still expect a robust codebase to have a proper number parser if you want to parse this sort of thing.
- nerdponx 4y agoWhat is regex but shorthand notation for a parser? I agree that a good codebase should generally have its regex segregated into standalone functions with their own tests (ideally property-based tests!).