Views:

The barcode regex is a regular expression that will be used to parse scanned product barcodes into the material code, serial number, batch number, and expiration date fields, when adding items, dramatically increasing the speed of adding new items compared to manually typing in each of these fields.

Example Product and Matching Regex

There are many online resources for aiding you in building a regex to parse your product's barcode format, but let’s walk through an example GS1 compliant barcoded product:

Visible Barcode: (01)00123655093160(10)12345678(17)210831(21)12373438003(30)1

Barcode Example

Barcode Output when scanned into Barcode field: ]C101001236550931601012345678172108312112373438003301

This barcode format contains four separate fields we want to parse.

        (1) itemnumber = 00123655093160

(10) batch = 12345678

(17) expirationdate = 210831

(21) serialnumber = 12373438003

A Barcode Regex that can read this barcode format will therefore be: ...01(?'itemnumber'\d{14})10(?’batch’\d{8})17(?'expirationdate'\d{6})21(?'serialnumber'.{11})...

In this case, the Expiration Date Format should be yyMMdd to interpret 210831 as August 31st, 2021.

It is possible to make the regex example above even more specific. For example, by requiring the 3rd number in the expiration date (210831) to always be either a 0 or a 1, you could greatly increase the chance that this character really is the first number in the month. Making your barcode regexes as specific as possible is important if you are reading a wide variety or product barcode formats, and do not want these barcodes being interpreted by multiple barcode regexes.

No Regex Workflow

Without a barcode regex that matches the scanned barcode, no information can be parsed into the item fields when adding a new item. The product barcode becomes effectively a worthless string of numbers, and the batch, serial, product, and expiration date information must be manually entered, which takes about 20-30 seconds per item.

Barcode Scanning Output with no matching regex

Regex Workflow

With a barcode regex that matches the scanned barcode, information can be automatically parsed fromthe barcode into the item fields when adding a new item. This turns adding an item into a matter of two quick barcode scans, and pressing svae changes, which takes about 3-4 seconds per item. Always use barcode regexes when possible! Theusers who are responsible for adding items will thank you.

With Barcode Regex Example

Viewing Barcode Regexes

Note: Viewing barcode regexes requires the "Product Management" role to be granted in your user record. Contact your system administrator to add this capability. Without this role, the Product Catalog will not even appear in your menu.

Barcode regexes are viewed and managed inside the product catalog page, via the "Manage Barcode Regexes" button.

Manage Barcode Regexes Button

To view a barcode regex's details, click the name of the barcode regex. In the details page you will all the available information for that barcode regex, including:

  • Name - An easily recognizable description of the Barcode Regex.
  • RegEx* - The Regular Expression used to parse the barcode into discrete data in Stratosphere. See example at the beginning of this article.
  • Expiration Date Formation - Needed if the regex parses expiration date. The regex can determine which numbers indicate the expiration date, but not what those numbers mean. Each number specified by the regex to be part of the expiration date must be interpreted as being part of the day, month or year.
    • d stands for Day
    • M stands for Month
    • y stands for Year

* = Required

Adding Barcode Regexes

Note: Adding barcode regexes requires the "Product Management" role to be granted in your user record. Contact your system administrator to add this capability.

Barcode Regexes are added to Stratosphere in order to aid in the rapid addition of items, which can use any matching barcode regex to parse the item’s barcode for any useful data to automatically associate with the item.

Note: You should make each RegEx you add as specific as possible, to reduce the chance that the barcode regex will "match" on barcodes it is not intended to read. For example, if you know the 1st character of a particular barcode will always be 0, specify 0 rather than just allowing any character, or even any number. When a user is adding items and the barcode they scan matches multiple barcode regexes, they will be forced to choose which of the matching regexes they want to use. If a barcode matching multiple barcode regexes is a frequent occurence, this will significantly slow down the addition of items.

To add a barcode regex,

1. Select "Add Barcode Regex" in the top left of the barcode regex page.

Add Barcode Regex Window

      2. Enter a Name, if desired.

      3. Enter a RegEx.

      4. Enter an Expiration Date Formation, if the regex is parsing expiration dates.

      4. Click Save Changes to finish adding the Barcode Regex. The Barcode Regex will appear in the Barcode Regexes table.

Editing Barcode Regexes

Note: Editing barcode regexes requires the "Product Management" role to be granted in your user record. Contact your system administrator to add this capability.

There are two options for editing a barcode regex.

Option 1

1.On the barcode regex page, open the quick action menu for the barcode regex you wish to edit and select "Edit"

Edit Barcode Regex Quick Action

2. In the Edit Barcode Regex window that opens, make any desired changes.

3. Click "Save Changes" to save the edited record. Clicking "Cancel" or the X in the top right of the window will remove any edits you just made but had not yet saved.

Option 2

1. On the barcode regex page, click the barcode regex name link.

Barcode Regex Name Link to Details

2. In the Barcode Regex details page, make any desired changes.

3. Click "Save Changes" to save the edited record. To cancel your edits, simply leave the barcode regex details page without saving.

Deleting Barcode Regexes

Note: Deleting barcode regexes requires the "Product Management" role to be granted in your user record. Contact your system administrator to add this capability.

Deleting a barcode regex prevents items added in the future from using that barcode regex to parse an item's barcode. It will not affect any existing item's that may have utilized the barcode regex when they were added.

Option 1

1. On the barcode regex page, open the quick action menu for the barcode regex you wish to delete and select "Delete"

Delete Barcode Regex Quick Action

2. In the "Delete Barcode Regex" confirmation window that appears, click "Delete" to confirm the deletion of the barcode regex. Clicking "Cancel" or the X in the top right of the window will not delete the barcode regex.

Option 2

1. On the barcode regex page, click the barcode regex name of the barcode regex you wish to delete.

Barcode Regex Name Link to Details

2. On the barcode regex details page that opens, scroll to the bottom of the page and click "Delete".

3. In the "Delete Barcode Regex" confirmation window that appears, click "Delete" to confirm the deletion of the barcode regex. Clicking "Cancel" or the X in the top right of the window will not delete the barcode regex.