# Regex and barcode scanner help

**URL:** <https://forum.inductiveautomation.com/t/regex-and-barcode-scanner-help/64531>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [September 27, 2022, 1:58pm UTC](https://forum.inductiveautomation.com/t/regex-and-barcode-scanner-help/64531 "2022-09-27T13:58:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 27, 2022, 2:13pm UTC](https://forum.inductiveautomation.com/t/regex-and-barcode-scanner-help/64531/2 "2022-09-27T14:13:31Z")

</div>

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

```auto
(3100[0-9]{28})$

```

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](https://forum.inductiveautomation.com/t/perspective-barcode-scanner-input-bad-idea-to-use-regex-on-a-numeric-code/63566/6)

---

_[View the full topic](https://forum.inductiveautomation.com/t/regex-and-barcode-scanner-help/64531)._
