I was wondering is there is any tool to match almost the same word for a bash terminal.
In the following file, called list.txt contain 1 word per line:
ban
1ban
12ban
12ban3
It is easy to find words containing "ban"
grep -E "*ban*" list.txt
Question:
How to actually match words that are have x letters differences? With the search word "ban", I expect the match "1ban" for X=1.
Concerning the notion of distance, I want to have maximum: X deletion or X substitutions or X insertions
Any tool, but preferentially something you could call as command-line on a bash terminal.
NOTE: The Levenshtein Distance will count an insertion of 2 letter as 1 difference. This is not what I want.