Open mallocator opened 9 years ago
This is exactly the functionality that I am looking for! I want to be able to match on barcodes such as UPC-A "06867916619\n" when a code is scanned.
// match UPC-A barcode
listener.register_regexcombo(/[0-9]{12,14}\n/);
Or, other codes such as: "1234-123-1234\n"
// match UPC-A barcode
listener.register_regexcombo(/[0-9]{4}-[0-9]{3}-[0-9]{4}\n/);
Interesting.
To be honest this would be a pretty big undertaking. If someone is interested in making a branch with regex support I would absolutely try my best to get it merged in.
You could enhance the matching by using regexes to match the input keys. I'm imagining some combos like
Or maybe you don't even need an extra function and can just detect if the input is a regex or not and go form there.
I've been looking for a catch all and this would solve that.