I am not very good at regex, and frankly find it difficult to wrap my head around. Therefore my question may not make any sense.
Could you use regular expressions to guarantee that when someone enters a string that it finds the closest fit from a list and makes it match one of the entries? Here is what the list might look like.
QR9456
QR6222
QR9487
QR2311
QR2311 AB
QR2311 A
QR4781
QR4781 A
XX920-009
QR9456 Z
I apologize if this question can't be answered or doesn't make sense.
Nope. Regexp:es only describe exact match to the patterns you specify: I doubt you could handcraft patterns to match the list above satisfactorily (much less define regexpes to match any list).
It sounds like what you are after is a fuzzy search algorithm like e.g. bitap.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With