Find best format for input string using prepared formats.
npm i format-matcher -S
Require and use
const makeMatcher = ;const formats = 'A 9' 'A-9' '9 A';const find = ;const input = 'H-1';const format = ;format === 'A-9'; // true
Any combination of characters are allowed for input and format,
but any non
- or space would be removed.
Thus for these formats would be treated as same:
A-9 A.- dot would be removed
A 8*-L- asterisk would be removed
Q-1 M=- equals would be removed
Same applies for inputs