{"id":1632,"date":"2019-10-02T11:01:19","date_gmt":"2019-10-02T18:01:19","guid":{"rendered":"https:\/\/portal.staylinked.com\/sl\/kb\/?post_type=ht_kb&#038;p=1632"},"modified":"2022-04-13T09:29:47","modified_gmt":"2022-04-13T16:29:47","slug":"regular-expressions","status":"publish","type":"ht_kb","link":"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/","title":{"rendered":"Regular Expressions"},"content":{"rendered":"\n<h2>Overview<\/h2>\n\n\n\n<p>This article describes the barcode regular expressions feature that provides a very flexible mechanism by which scanned barcode data can be manipulated by the StayLinked Server before that data is entered into the Telnet Session. StayLinked has always provided barcode data manipulation capabilities, but the barcode regular expression feature provides the ultimate flexibility and capability to manipulate scanned barcode data. <\/p>\n\n\n\n<h2>What are Regular Expressions?<\/h2>\n\n\n\n<p>Regular expressions provide the ability to describe and identify specific patterns of words or characters in strings of text. In the StayLinked context, the strings of text are the data in the scanned barcodes. Using regular expressions, you can describe a pattern to match the text in scanned barcode data. The pattern is specified using a pre-defined&nbsp;syntax that is processed by the Java-based regular expression parser inside the StayLinked server. If a match is identified, then a replacement string can be processed which is used to manipulate and transform the scanned barcode data into its desired form.<\/p>\n\n\n\n<p>So, when using regular expressions with StayLinked,\nyou will provide an \u2018Expression\u2019 string which uses regular expression syntax\n(Java \u2013 similar to PERL) to describe a pattern to be matched in the scanned\nbarcode data. You will also provide a \u2018Replacement\u2019 string which describes how\nto manipulate the scanned barcode data and transform that data into the desired\nformat.<\/p>\n\n\n\n<p>To learn more about regular expressions, we recommend reviewing these resources:<br><a href=\"http:\/\/en.wikipedia.org\/wiki\/Regular_expression\">http:\/\/en.wikipedia.org\/wiki\/Regular_expression<\/a><br><a href=\"http:\/\/www.regex101.com\">www.Regex101.com<\/a> <\/p>\n\n\n\n<h2>Composing an \u2018Expression\u2019 to match a pattern in barcode data<\/h2>\n\n\n\n<p>An \u2018expression\u2019 is a pattern that is composed of simple characters, such as <strong>\/123\/<\/strong>, or a combination of simple and special characters, such as <strong>\/12*3\/<\/strong> or <strong>^PART(\\d+)$<\/strong>. The last example uses \u2018capturing parentheses\u2019 to identify some of the data in the pattern. The barcode data that matches the part of the pattern inside the \u2018capturing parenthesis\u2019 is stored in memory for later use in the \u2018Replacement\u2019 string.<\/p>\n\n\n\n<h2>Simple Patterns used in an \u2018Expression\u2019<\/h2>\n\n\n\n<p>Simple patterns are constructed of characters for which you want to find a direct match. For example, the pattern <strong>\/BIN\/<\/strong> matches character combinations in barcode data only when exactly the characters \u201cBIN\u201d occur together and in that order. Such a match would succeed in the barcodes \"BIN98654\" and \"LOC55BIN99\". In both cases the match is with the exact characters \u201cBIN\u201d. There is no match found in the barcode data \"BOX55967LOT559\" because it does not contain the exact characters \u201cBIN\u201d.<\/p>\n\n\n\n<h2>Special Characters used in an \u2018Expression\u2019<\/h2>\n\n\n\n<p>When the search for a matching pattern requires something more than a direct match, such as finding one or more B's, or finding white space, then you can include special characters in the expression. For example, the pattern <strong>\/12*3\/ <\/strong>matches any character combination in which a single \u201c1\u201d is followed by zero or more \u201c2\u201ds (* means 0 or more occurrences of the preceding item) and then immediately followed by \u201c3\u201d. In the string \"3221222234523,\" the pattern matches the substring \u201c122223\u201d.<\/p>\n\n\n\n<p>The following matrix provides a complete list and description of the special characters that can be used in your expressions.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft is-resized\"><img loading=\"lazy\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1.jpg\" alt=\"\" class=\"wp-image-1634\" width=\"638\" height=\"334\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1.jpg 915w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1-300x157.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1-768x402.jpg 768w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1-50x26.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1-60x31.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1-100x52.jpg 100w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" width=\"924\" height=\"558\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.2.jpg\" alt=\"\" class=\"wp-image-1636\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.2.jpg 924w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.2-300x181.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.2-768x464.jpg 768w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.2-50x30.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.2-60x36.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.2-100x60.jpg 100w\" sizes=\"(max-width: 924px) 100vw, 924px\" \/><\/figure><\/div>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"920\" height=\"562\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.3.jpg\" alt=\"\" class=\"wp-image-1637\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.3.jpg 920w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.3-300x183.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.3-768x469.jpg 768w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.3-50x31.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.3-60x37.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.3-100x61.jpg 100w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"927\" height=\"543\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.4.jpg\" alt=\"\" class=\"wp-image-1638\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.4.jpg 927w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.4-300x176.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.4-768x450.jpg 768w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.4-50x29.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.4-60x35.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.4-100x59.jpg 100w\" sizes=\"(max-width: 927px) 100vw, 927px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"916\" height=\"209\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.5.jpg\" alt=\"\" class=\"wp-image-1639\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.5.jpg 916w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.5-300x68.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.5-768x175.jpg 768w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.5-50x11.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.5-60x14.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.5-100x23.jpg 100w\" sizes=\"(max-width: 916px) 100vw, 916px\" \/><\/figure>\n\n\n\n<h2>Using Parenthesis to make Capturing Groups<\/h2>\n\n\n\n<p>The \u2018Expression\u2019 string that you\ncompose has two functions. First, the expression is used to match a pattern of\ncharacters in the scanned barcode data. Second, the expression identifies any\nparts of the scanned barcode data that you want to be included in the\n\u2018Replacement\u2019 string that will ultimately be entered into the telnet session.<\/p>\n\n\n\n<p>When the scanned barcode data matches an \u2018Expression\u2019, those parts of that barcode data that you want to use in the \u2018Replacement\u2019 string are indicated by those parts of the \u2018Expression\u2019 string that are surrounded by parenthesis to make \u2018capturing groups\u2019. Any scanned barcode data enclosed in a \u2018capturing group\u2019 is remembered in memory and can be referred to in the \u2018Replacement\u2019 string.<\/p>\n\n\n\n<p>Your \u2018Expression\u2019 can include zero of more of these \u2018capturing groups\u2019. The data identified by the \u2018capturing group\u2019 are stored in memory and are identified sequentially; [1], [2], &#8230;, [n]. In your \u2018Replacement\u2019 string, you can refer to these remembered data using <strong>$1, $2, \u2026, $n<\/strong> syntax.  Also note that in Screen Recognition, 'capturing groups' from previous screens can be used with the mnemonic [regexgroup #], where # is the sequential group as noted above.  [regexgroup 0] will clear the previously captured groups from memory.<\/p>\n\n\n\n<p>For example, the expression <strong>^PART(\\d+)$ <\/strong>matches any scanned barcode data that starts with (<strong>^<\/strong>) the text\u00a0 <strong>PART<\/strong> and ends with (<strong>$<\/strong>) 1 or more numeric digits (<strong>\\d+<\/strong>). The numeric digits portion of the expression is enclosed in the \u2018capturing group\u2019 and will be remembered in memory. This remembered data can be referred to in the Replacement string using <strong>$1<\/strong>. If the scanned barcode data was <strong>PART1234567890,<\/strong> then the expression would match this data and the \u2018capturing group\u2019 would remember the value of\u00a0 <strong>1234567890<\/strong>. If the \u2018Replacement\u2019 string were defined as <strong>$1<\/strong>, then the result of the regular expression replacement processing would be <strong>1234567890<\/strong> which would be sent to the telnet session. If the \u2018Replacement\u2019 string were defined as <strong>ITEM$1<\/strong>, then the scanned barcode data would be transformed into <strong>ITEM1234567890<\/strong> which would be sent to the telnet session.<\/p>\n\n\n\n<p>The following examples show the \u2018Add Regular Expression\u2019 dialog. Using this dialog, you can compose your Expression and Replacement strings. You can even enter Sample Barcode Data to test your individual Regular Expressions in real time.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft is-resized\"><img loading=\"lazy\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.6.jpg\" alt=\"\" class=\"wp-image-1640\" width=\"422\" height=\"384\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.6.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.6-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.6-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.6-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.6-100x91.jpg 100w\" sizes=\"(max-width: 422px) 100vw, 422px\" \/><\/figure><\/div>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.7.jpg\" alt=\"\" class=\"wp-image-1641\" width=\"425\" height=\"386\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.7.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.7-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.7-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.7-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.7-100x91.jpg 100w\" sizes=\"(max-width: 425px) 100vw, 425px\" \/><\/figure>\n\n\n\n<h2>Creating and Testing Regular Expressions<\/h2>\n\n\n\n<p>You can assign barcode rules to either \u2018Device Groups\u2019 or to \u2018Telnet Host Entries\u2019. To specify Regular Expressions for your barcodes, you must add a specific rule for the specific \u2018Barcode Type\u2019 that is being scanned. In this example, we have added a barcode rule to the \u2018Default Device Group\u2019 for the Code 3 of 9 barcode type with any length (Min. and Max. Length equals 0).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"408\" height=\"512\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.8.jpg\" alt=\"\" class=\"wp-image-1642\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.8.jpg 408w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.8-239x300.jpg 239w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.8-40x50.jpg 40w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.8-48x60.jpg 48w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.8-80x100.jpg 80w\" sizes=\"(max-width: 408px) 100vw, 408px\" \/><\/figure>\n\n\n\n<p>In this dialog you will find the\n\u2018Regular Expression Processing\u2019 listing which provides the ability to define\nmultiple regular expressions to be processed against the scanned barcode data\nthat meets the criteria defined by this barcode rule. When scanned barcode data\nis received by the server, the barcode rule that most closely matches the\n\u2018Barcode Type\u2019 and the \u2018Min. and Max. Lengths\u2019 will be processed. Within this\nbarcode rule, all of the barcode manipulation functions are processed in dialog\norder, from the top down. So, \u2018Regular Expression Processing\u2019 is applied after\n\u2018Use First ## Digits\u2019 and before \u2018Scan Prefix\u2019 and \u2018Scan Suffix\u2019. Additionally,\nif you define multiple \u2018Regular Expressions\u2019 to be processed, then they are\nprocessed in order and the result of the current expression is used as the data\nfor the following expression. In this way, it is possible that a scanned\nbarcode could be transformed by one or more of the defined regular expressions\nwith the ultimate result being entered into the telnet session.<\/p>\n\n\n\n<p>Because the \u2018Regular Expressions\u2019 functionality is so powerful and flexible, there is really no need to use any of the other barcode manipulation functions. All of those functions can be accomplished using \u2018Regular Expression Processing\u2019 alone.<\/p>\n\n\n\n<p>You can right-click in the Regular\nExpression list to access a context menu which provides the following options:<\/p>\n\n\n\n<p><strong>Add<\/strong> \u2013 Adds a new regular expression to the list.<\/p>\n\n\n\n<p><strong>Edit<\/strong> \u2013 Edit and test the selected regular expression.<\/p>\n\n\n\n<p><strong>Copy <\/strong>\u2013 Copy the selected regular expression to the clip-board.<\/p>\n\n\n\n<p><strong>Paste <\/strong>\u2013 Paste the copied regular expression into a new \u2018Paste\u2019\ndialog.<\/p>\n\n\n\n<p><strong>Delete <\/strong>\u2013 Delete the selected regular expression.<\/p>\n\n\n\n<p><strong>Move Up<\/strong> \u2013 Change the order of regular expression processing by\nmoving the selected expression up in the list.<\/p>\n\n\n\n<p><strong>Move Down<\/strong> \u2013 Change the order of regular expression processing by\nmoving the selected expression down in the list.<\/p>\n\n\n\n<p><strong>Import <\/strong>\u2013 Import Regular Expressions that were previously exported\ninto a Regex File (*.rgx).<\/p>\n\n\n\n<p><strong>Export <\/strong>\u2013 Export the currently defined list of Regular Expressions\ninto the desired Regex File (*.rgx).<\/p>\n\n\n\n<p><strong>Test Expressions <\/strong>\u2013 Opens a testing dialog that will allow you to\ntest various sample scanned barcode data and review the results as that data is\nprocessed by each of the regular expressions in the current order.<\/p>\n\n\n\n<p>When you add or edit an expression, you will use this dialog:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"393\" height=\"357\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.9.jpg\" alt=\"\" class=\"wp-image-1643\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.9.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.9-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.9-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.9-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.9-100x91.jpg 100w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p><strong>Expression<\/strong> \u2013 Compose your Expression string in this text box.<\/p>\n\n\n\n<p><strong>Replacement <\/strong>\u2013 Compose your Replacement string in this text box.<\/p>\n\n\n\n<p><strong>Sample Barcode Data <\/strong>\u2013 Enter some sample barcode data in this text\nbox.<\/p>\n\n\n\n<p><strong>Results <\/strong>\u2013 This text box will display the results of the \u2018Expression\u2019 string and the \u2018Replacement\u2019 string after processing against any \u2018Sample Barcode Data\u2019 that you have entered. The \u2018Results\u2019 value is updated in real time as any of the other elements are changed.<\/p>\n\n\n\n<p>When you select the \u2018Test Expressions\u2019 option, you will be presented with this dialog:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"681\" height=\"223\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.10.jpg\" alt=\"\" class=\"wp-image-1644\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.10.jpg 681w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.10-300x98.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.10-50x16.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.10-60x20.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.10-100x33.jpg 100w\" sizes=\"(max-width: 681px) 100vw, 681px\" \/><\/figure>\n\n\n\n<p>This dialog will display the\ncurrently defined Regular Expressions. The Expression and Replacement strings\nwill be displayed in their respective columns. As you type in some sample\nbarcode data, the Data and Result columns will be updated in real time.<\/p>\n\n\n\n<p>It is important to remember that multiple regular expressions are processed in order with the result of the current expression used as the data for the next expression. In the example above, you can see that the sample barcode data was transformed by the first regular expression and the result became the data for the next regular expression. But, the next regular expression had no effect on that data because there was no pattern match.<\/p>\n\n\n\n<h2>Examples of Regular Expressions<\/h2>\n\n\n\n<p>Following are several examples of Regular Expressions used to transform scanned barcode data for some common uses:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"393\" height=\"357\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.11.jpg\" alt=\"\" class=\"wp-image-1645\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.11.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.11-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.11-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.11-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.11-100x91.jpg 100w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p>This regular expression removes the\nlast character from any alpha-numeric barcode data of at least one character.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"393\" height=\"357\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.12.jpg\" alt=\"\" class=\"wp-image-1646\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.12.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.12-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.12-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.12-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.12-100x91.jpg 100w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p>This regular expression removes the first and the last character from any alpha-numeric barcode data of at least two characters.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"393\" height=\"357\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.13.jpg\" alt=\"\" class=\"wp-image-1647\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.13.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.13-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.13-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.13-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.13-100x91.jpg 100w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p>This regular expression removes\nall white space from the scanned barcode data.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"393\" height=\"357\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.14.jpg\" alt=\"\" class=\"wp-image-1648\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.14.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.14-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.14-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.14-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.14-100x91.jpg 100w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p>This regular expression will provide only the first five characters of scanned barcode data of any length.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"393\" height=\"357\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.15.jpg\" alt=\"\" class=\"wp-image-1649\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.15.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.15-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.15-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.15-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.15-100x91.jpg 100w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p>This regular expression will replace every occurrence of an asterisk (*) with an upper-case X.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"393\" height=\"357\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.16.jpg\" alt=\"\" class=\"wp-image-1650\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.16.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.16-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.16-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.16-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.16-100x91.jpg 100w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p>This regular expression will replace every occurrence of the word PART with the word ITEM.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"393\" height=\"357\" src=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.17.jpg\" alt=\"\" class=\"wp-image-1651\" srcset=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.17.jpg 393w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.17-300x273.jpg 300w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.17-50x45.jpg 50w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.17-60x55.jpg 60w, https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.17-100x91.jpg 100w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p>This regular expression will match\na barcode that starts with <strong>]C1229<\/strong> followed by a group of five digits\n($1) followed by a 3 followed by a group of 6 digits ($2) followed by a group\nof 5 to 10 digits ($3) and ending with any one digit. The returned value will\nbe the group of 5 to 10 digits ($3).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview This article describes the barcode regular expressions feature that provides a very flexible mechanism by which scanned barcode data can be manipulated by the StayLinked Server before that data is entered into the Telnet Session. StayLinked has always provided barcode data manipulation capabilities, but the barcode regular expression feature&#8230;<\/p>\n","protected":false},"author":7,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[],"ht-kb-tag":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Regular Expressions &ndash; StayLinked<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.staylinked.com\/knowledge-base\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Regular Expressions &ndash; StayLinked\" \/>\n<meta property=\"og:description\" content=\"Overview This article describes the barcode regular expressions feature that provides a very flexible mechanism by which scanned barcode data can be manipulated by the StayLinked Server before that data is entered into the Telnet Session. StayLinked has always provided barcode data manipulation capabilities, but the barcode regular expression feature...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/\" \/>\n<meta property=\"og:site_name\" content=\"StayLinked\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-13T16:29:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/#website\",\"url\":\"https:\/\/portal.staylinked.com\/sl\/kb\/\",\"name\":\"StayLinked Knowledge Base\",\"description\":\"Partner Portal Resources and Support\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/portal.staylinked.com\/sl\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1.jpg\",\"contentUrl\":\"https:\/\/portal.staylinked.com\/sl\/kb\/wp-content\/uploads\/2019\/10\/RegularExpressions_1.1.jpg\",\"width\":915,\"height\":479},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/#webpage\",\"url\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/\",\"name\":\"Regular Expressions &ndash; StayLinked\",\"isPartOf\":{\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/#primaryimage\"},\"datePublished\":\"2019-10-02T18:01:19+00:00\",\"dateModified\":\"2022-04-13T16:29:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/regular-expressions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/portal.staylinked.com\/sl\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Regular Expressions\"}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb\/1632"}],"collection":[{"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/comments?post=1632"}],"version-history":[{"count":2,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb\/1632\/revisions"}],"predecessor-version":[{"id":3969,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb\/1632\/revisions\/3969"}],"wp:attachment":[{"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/media?parent=1632"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=1632"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=1632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}