Skip to content

Instantly share code, notes, and snippets.

View dprelec's full-sized avatar

Darko Prelec dprelec

  • Zagreb, Croatia
View GitHub Profile
@ingydotnet
ingydotnet / word-parse.pl
Last active November 26, 2015 04:57
Parse words from a string of smushed together words with a single regexp
#!/usr/bin/env perl
use strict;
# Get all the letters from stdin:
my $input = do {local $/; <>};
$input =~ s/[^a-zA-Z]//g;
# All 3+ letter English words, longest to shortest:
my @long = grep {length > 2}
sort {length $b <=> length $a}