Perspective Barcode Scanner Input: Use multiple regex on same component

I’m used to the Sepasoft barcode scanner component in Vision where I have multiple named regex patterns on a single component. For example, my session will need to scan different barcode formats and run a script according to the barcode type. The only way I can think of mimicking this behavior is to handle the regex processing inside an event script and not the regex property. Is that right?

I think I will have to do this in scripting.

Also, how can I use a carriage return for the suffix? (0x0d)

I think you do have you use scripting, yes. If you're using key event scripts to capture, then note that the regex is being run on the frontend, and there's some... weird Javascript quirks as a result:

1 Like

I’m using the scanner component, and applying my different regex’s in an onActionPerformed script. It works fine, I just want to make the suffix property a CR (0x0d) but just seems to take literal text.

I think you need to use an expression or script to populate with a literal, e.g. \r.

I guess you can't do that, I tried it without success.

It should work as long as you don’t try to manually edit it:
image
image

1 Like

I still couldn’t get it to work, but I think the regex is really the way to go. That way I don’t have to program prefixes or suffixes. You can apply multiple regexes with | although that doesn’t tell you which pattern matched in the script, but that can be handled inside the script. Thanks!