|
|
|
|
|
by IshKebab
1435 days 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. |
|
I agree that a good codebase should generally have its regex segregated into standalone functions with their own tests (ideally property-based tests!).