Regex and barcode scanner help

Hi Guys,

Please your help with some barcode scanner and the regex.

We need to read this kind of code:


The 3100 is the prefix but we don’t have a suffix, so i think we need some regex and despite i have some progress, i can’t get what i want.

The only things that we have for the regex are the initial **3100 and the lenght of the string.

We need that the barcode scanner from perspective read the string as one data (not every char in the data array). Like this:

Thanks in advance friends and best regards.

A couple of things you could do.

  1. Most scanners can add a suffix to the barcode without it actually being apart of the barcode like a tab, line feed, carriage return, or any other character. Just program the scanner to add a suffix of your choice

  2. If you do use regex, it would be something like this


The barcode must start with 3100, then must have 28 digits matching 0-9.

Note: I found that regex with the barcode scanner component to be flawed.
Perspective Barcode Scanner Input: Bad Idea to use Regex on a Numeric Code? - Ignition - Inductive Automation Forum



Thank you very much

1 Like