# RegEx with BarcodeInput component

**URL:** <https://forum.inductiveautomation.com/t/regex-with-barcodeinput-component/99387>\
**Category:** Ignition\
**Created:** [December 3, 2024, 10:05pm UTC](https://forum.inductiveautomation.com/t/regex-with-barcodeinput-component/99387 "2024-12-03T22:05:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 3, 2024, 11:49pm UTC](https://forum.inductiveautomation.com/t/regex-with-barcodeinput-component/99387/4 "2024-12-03T23:49:23Z")

</div>

Apparently JS key event matching (or at least what we do in Perspective) doesn't work in a sane way, so you might need to match against the literal string `Enter` as your end-of-line character?

> [@Perspective Key Event Regex New Line](https://forum.inductiveautomation.com/t/perspective-key-event-regex-new-line/51553/10):
>
> This is expected behavior, all. At the core of the regex match is the data that we receive from a [JavaScript KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent) because this executes in the scope of the browser. We’re assembling a character sequence to match against from an input source (your barcode scanner) that creates KeyboardEvents. A “new line” character shows up as a key press for the “Enter” key. [https://keycode.info/](https://keycode.info/) is a pretty decent way to test what KeyboardEvent data your sequence would produce. It tests a key at a…

---

_[View the full topic](https://forum.inductiveautomation.com/t/regex-with-barcodeinput-component/99387)._
