3 ms·
Spoiled by grep: cat words \ | grep -E '^(da[^y]|d[^a]y|[^d]ay|[^d][^a][^y])$' \ | grep -E '^(ma[^y]|m[^a]y|[^m]ay|[^m][^a][^y])$' \ | grep -E '^(b
by omoikane 2y ago
Spoiled by grep:
cat words \
| grep -E '^(da[^y]|d[^a]y|[^d]ay|[^d][^a][^y])$' \
| grep -E '^(ma[^y]|m[^a]y|[^m]ay|[^m][^a][^y])$' \
| grep -E '^(bu[^y]|b[^u]y|[^b]uy|[^b][^u][^y])$' \
| grep -E '^(s[^a][^y]|[^s]a[^y]|[^s][^a]y)$' \
| grep -E '^(d[^u][^e]|[^d]u[^e]|[^d][^u]e)$' \
| grep -E '^(t[^e][^n]|[^t]e[^n]|[^t][^e]n)$'
- lupire 2y agoTyping that is harder then solving. Need a version that generates the grep from input
- omoikane 2y agoI generate those with VIM macros. For example, I might type "day", "may", and "buy" on separate lines, move cursor to "day" and then type something like qayy3pklli[^<ESC>A]|<ESC>gJli[^<ESC>la]<ESC>A|<ESC>gJi[^<ESC>la]<ESC>A|<ESC>gJi[^<ESC>la][^<ESC>la][^<ESC>la]<ESC>q And then @a to apply the same expansion to "may" and "buy". (Rather than parsing the keystrokes above, it's probably easier to derive keys with similar effects by using VIM interactively).
- thih9 2y agoWhat about exact matches for words from the odd list? This wasn’t the case here but in theory ‘see’ could have been in the odd list.