i need to recognize a barcode using the Barcode Scanner Input.
I need to recognize codes like:
The follow RegEx doesn’t work as aspected.
It recognize the First Letter and only the First Number so the “H1” and the “H12” return only H1…
I tried a lot of RegEx but with not success…
What i’m doing wrong?
I would expect a regex of
([HDP]\d+) to work.
No, it doesn’t work. I already tried a lot of time… It return only First Letter and First Digit…
Ah. Try this:
The regex match is returning as soon as the first match is found, not waiting for more input. If your scanner is configured to terminate the scan with a keypress of Enter, you can capture that (
outside of the group) and it will work:
To solve this problem at the moment i added a PREFIX and SUFFIX in Scanner Data Output like:
The RegEx work in this case…
If you’re using prefix or suffix, the regex property is ignored. If your barcodes end in
#, you could use that with the updated regex I posted above, just replace