3 ms·
I once used the wonderful perl module [Regexp::Assemble](https://metacpan.org/pod/Regexp::Assemble https://metacpan.org/pod/Regexp::Assemble) to produce a regex
by singingfish 11y ago
I once used the wonderful perl module [Regexp::Assemble](https://metacpan.org/pod/Regexp::Assemble https://metacpan.org/pod/Regexp::Assemble) to produce a regexp to match [every single suburb/town name in Australia](https://gist.githubusercontent.com/singingfish/d43c884fbac0089d8523/raw/63eeaf88a2e8d896c07da3b2440080233dd48395/regex%2520for%2520every%2520suburb%2520name%2520in%2520australia.txt https://gist.githubusercontent.com/singingfish/d43c884fbac00...) from a csv file download from the post office website. It was blazingly fast ... considering (better than the recdescent parser I'd been previously experimenting with).
Here's the code that generated the regex:
use Regexp::Assemble;
my $ra = Regexp::Assemble->new;
while (<$FH>) {
$csv->parse($_);
next if $. == 1;
my @fields = $csv->fields;
$ra->add($fields[1]);
}
my $suburbs = $ra->as_string;
- voltagex_ 11y agoCan you still get that csv file? I thought AusPost had started charging for everything.
- singingfish 11y agoyeah I heard that, not very sportsmanlike of them if it's the case.
- x0 11y agobam http://badcunt.club/cant/stop/information/babe/every-australian-postcode.csv http://badcunt.club/cant/stop/information/babe/every-austral...
- x0 11y agoWoah, do you mean this? If so, wow, never thought my tiny little data collection would come in handy. http://badcunt.club/cant/stop/information/babe/every-australian-postcode.csv http://badcunt.club/cant/stop/information/babe/every-austral...