4 ms·
I tested the 44k optimised Perl regexp but it seemed to let through some other stuff - i.e. replacing the leading 0 with 8 allowed through a bunch of numbers th
by zimpenfish 5y ago
I tested the 44k optimised Perl regexp but it seemed to let through some other stuff - i.e. replacing the leading 0 with 8 allowed through a bunch of numbers that aren't on the original list.
e.g. changing 02071160299 to 82071160299 still appears to pass the regexp.
- zamadatix 5y agoProbably the cardinal sin of regex: forgetting the anchors. Also something really weird: when I view zimpenfish's comment in the post it shows as 54 minutes old which makes sense, when I click it to view direct or reply it shows as 2 days old which is really wonky. Any idea what is going on there? https://i.imgur.com/DvBDcIL.png https://i.imgur.com/DvBDcIL.png
- skinkestek 5y agoThat's funny... Might be something that got resubmitted from the second chance pool and then automatical rewrite only did half the work it should or something is cached or something similar?
- Recursing 5y agohttps://shkspr.mobi/blog/2021/05/the-74000-numbers-of-barclays-bank/#comment-215502 https://shkspr.mobi/blog/2021/05/the-74000-numbers-of-barcla... it's mentioned in another comment that indeed they forgot the anchors The "correct" regex is 11KB and can be found here https://gist.github.com/jes/e678e4300d1cfcbcc12b46aaa7e58e30 https://gist.github.com/jes/e678e4300d1cfcbcc12b46aaa7e58e30 I agree with another comment here that the 1.3MB JSON is a better solution though
- ahmedfromtunis 5y agoI'm sure that this regex wasn't manually created. Is there a service or tool to create such regex?
- Recursing 5y agoIndeed, here is the source from the linked comment https://gist.github.com/jes/c7b848220bc36d8ae3771cd77f232d0c https://gist.github.com/jes/c7b848220bc36d8ae3771cd77f232d0c
- philjohn 5y agoYou can go a long way by building a Trie and walking it to autogenerate a regex, although optimising it is a more complex challenge.