4 ms·
I'm struggling to see how a regex would work, either. It's a database lookup, a regex that matches only 74k numbers out of every possible valid phone number in
by ljm 5y ago
I'm struggling to see how a regex would work, either. It's a database lookup, a regex that matches only 74k numbers out of every possible valid phone number in the UK would be absurd.
- staz 5y agoI think the intuition is that a lot of these phone number come in ranges, so it would not be a regex but multiples? But yeah seems easier to just encode the ranges, than some complex system to create the most minimal regex. edit: checked the comments of the original post and they apparently used perl to produce a 11kb regex.
- alexwasserman 5y agoI assumed they meant that a regex here could be used to just extract out the numbers and remove anything extraneous. They mention it fails with trailing characters, or typical punctuation used in numbers (eg. dashes). A little regex to remove out anything non-digit would leave you with just the numbers to compare to the numbers in the list.