--- title: "Identify Line Items in the Input (Patterns)" slug: "identify-line-items-in-the-input-data" description: "Describes how to specify data patterns for a Lasernet Core form." tags: ["Form Editor", "Lasernet Core", "Patterns"] updated: 2026-04-15T12:58:57Z published: 2026-04-15T12:58:57Z canonical: "kb.lasernetgroup.com/identify-line-items-in-the-input-data" --- > ## Documentation Index > Fetch the complete documentation index at: https://kb.lasernetgroup.com/llms.txt > Use this file to discover all available pages before exploring further. # Identify Line Items in the Input (Patterns) Patterns are used to recognize line items in input data. For example, you can use a pattern to recognize repeating elements in the input data (such as the transactions in banking data or the line items in invoice data) so that you can identify and add that line item data to the output document. Patterns are defined in Lasernet Developer’s pattern mode, which is activated by clicking the **Pattern** tool in the toolbar. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/pattern 1.png) The effect of clicking the button depends on the type of input data that the form accepts. Refer to the information that corresponds to the form’s input data type: **XML input data** The button enables pattern mode. To specify a pattern in the data, see [Setting up a Pattern](/v1/docs/identify-line-items-in-the-input-data#setting-up-a-pattern). **Text input data** **Applies to:** Lasernet Core 11 and 10 (not Lasernet Essentials / Professional / Advanced) In pattern mode, a panel is shown on the right-hand side showing already defined patterns and controls for adding, removing, editing and changing the pattern’s priority. To change a pattern’s priority, highlight it and then click **Move Up** and **Move Down** to move it up or down the list. To specify a pattern in the data, see [Setting up a Pattern](/v1/docs/identify-line-items-in-the-input-data#setting-up-a-pattern). > [!NOTE] > Note > > Click the **Back** button or close the **Patterns** panel to exit pattern mode. ### Setting up a Pattern The process of setting up a pattern depends on the type of input data that the form accepts. Refer to the information that corresponds to the form’s input data type: **XML input data** XML files typically contain multiple item lines. Therefore, it is likely that you will need to use the pattern tool to define and recognize them. An XML invoice could be expressed using a tag named `<BillingInformation/ItemLine>` with sub-tags containing the description and amount. Each `<BillingInformation/ItemLine>` tag would then have an ID field uniquely identifying the tag within the XML file. In the example below, all the `<BillingInformation/ItemLine>` tags will be mapped to the lines of an invoice created by Lasernet Core. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/input xml 11.png) To define a range of tags as a pattern, mark the relevant tag using the **Pattern** tool. The picture above contains an example of this. The `<BillingInformation/Header>` tag has been selected as the **Start pattern criterion** using an empty **Match** field and **exists** selected as the **Operator**. This will force Lasernet Core to test if the XML file contains the tag `<BillingInformation/Header>` and recognize it as a pattern. When you have selected a tag as the **Start** pattern criteria, all of the corresponding tags are marked in green. The individual information items can now be marked within the tag using the Rearrange tool. > [!NOTE] > Note > > The node path is relative to the top node, meaning that the name of the top node should not be included. **Text input data** **Applies to:** Lasernet Core 11 and 10 (not Lasernet Essentials / Professional / Advanced) To define a pattern, first use the **Select** tool to highlight the line(s) to be included. Commonly, this is the same line as used in the line criterion. Please note the light green pattern marker on the left side of the screen. The pattern marker is used as a guideline while defining patterns. The size of the marker corresponds with the pattern height defined in the Pattern Properties. Patterns are set up by selecting the **Line Criterion** tool and drawing a rectangle around the individual elements of the pattern. See the example below: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/pattern 3.png) In the above example, you can see a grey box representing a pattern criterion. In the example, the pattern matches any rows containing an 8-character long alpha-numeric string located between columns 21 to 28. When a criterion is marked using the **Line Criterion** tool, a dialog appears showing the element’s properties. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/pattern 4.png) The **Edit Criterion** dialog contains the following settings. | Property | Description | | --- | --- | | **Row** | The row number within the pattern. This value is normally 1, reflecting the actual row where the criterion was found, though it is possible to set other values. For example, setting the value to 2 includes the current row and, if the criterion matches, the content on the row underneath. Setting a value of -1 tests the criterion against the row above instead. | | **Start Col** | Start column for the criteria. | | **End Col** | End column for the criteria. | | **Match** | The expression that is matched by the pattern. This can be edited to match alphanumeric values rather than an explicitly defined text string. In the example above, the text string can also be changed to **????????**, resulting in the pattern matching all rows containing any string at the specified position. | | **Regular ex.** | This checkbox indicates that the match string is a regular expression. | | **Case sensitive** | This checkbox indicates whether the match string is case-sensitive or not. | The area selected is initially contained in the **Match** field. The criteria can now be edited to make it generic, which is essential for the pattern to be able to recognize other similar data elements. ### Wildcards These are the available wildcards used for defining a pattern. | Wildcard | Description | | --- | --- | | ? | Indicates any character, including spaces. | | X | Indicates a letter – not numbers and spaces. | | 9 | Indicates a number from 0-9 | | $ | Indicates a number, spaces, comma, period, and “-“ | | § | Indicates the letters x or X | | ¤ | Indicates the digit 9 | > [!NOTE] > Note > > Wildcards are not used in “Regular ex.” mode. ## Edit a Pattern The Pattern Properties window enables you to edit a pattern. Refer to the information that corresponds to the form’s input data type: **XML input data** Double-click the pattern row in the XML. As a result, the **Pattern Properties** dialog opens. **Text input data** **Applies to:** Lasernet Core 11 and 10 (not Lasernet Essentials / Professional / Advanced) A pattern can be edited by selecting it in the **Patterns** panel and then performing one of the following actions: - Clicking the **Edit** button on the toolbar of the **Patterns** panel. - Right-clicking the pattern record, and then clicking **Edit** on the context menu that appears. - Double-clicking the pattern record. As a result, the **Pattern Properties** dialog opens. ## Input Tab ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/pattern 5.png) For each pattern, there is a list of predefined criteria under the **Input** tab. Each criterion contains the following fields: **Name**, **Type**, **Row**, **Column** and **Match**. The following options are available on the **Input** tab of the **Pattern Properties** dialog. | Property | Description | | --- | --- | | **Add** | Clicking the **Add** button brings up a dialog allowing a new criterion to be manually added. | | **Remove** | Removes the selected criterion. | | **Move Up** | Moves the selected criterion up one place. | | **Move Down** | Moves the selected criterion down one place. | | **Edit** | Clicking the **Edit** button brings up a dialog allowing you to manually change the properties of the selected criterion. | | **Pattern Expression** | The **Pattern Expression** field can be used for defining a set of criteria which must be true (or false). Further information about expressions can be found in the Form Expressions part of [Use Criteria](/v1/docs/use-criteria#form-expressions). | | **Instance(s) qualifiers** | Extends pattern expressions so that the following instances: 1. All, 2. First, 3. Middle, which is/are all non-first and non-last, 4. Last, 5. Single, which is the only one existing line of the pattern match those ones which belong to: 1. Scope of all instance, 2. Sequence of the pattern instances (no other patterns match lines between two or more sequences), 3. Region containing instances of the pattern, 4. Group containing instances of the pattern, 5. All instances of the pattern in conditional area on a page. Both the **All Position(s)** checkbox and **Scope All** radio button are selected by default. As such, the remaining controls (**First**, **Middle**, **Last** and **Single** check boxes, and **Sequence**, **Region**, **Group** and **Page** radio buttons) are disabled. To enable these controls, clear the **All Position(s)** checkbox. Various combinations of the controls are possible. Selecting the **Page** button disables the **Single** checkbox. | | **Pattern Height** | The **Pattern height** field defines the number of lines that the pattern will span. This can be used to match order lines where the data spans across multiple lines. | | **Allow further pattern matching** | After matching the pattern and producing output, the algorithm will then continue to try matching the current line against the rest of the patterns in the list. | | **Active** | Toggles a pattern active/inactive. If the check box is selected, the pattern is active and is normally processed. If the checkbox is cleared, the pattern becomes inactive and is not processed or shown in the output or the input. > [!NOTE] > Note > > Even if a pattern is hidden and not shown in the output, it is still listed in the Pattern and Rearranges dialog which you can access via **Sheet** > **Patterns and Rearranges**. | ## Output Tab ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/pattern 6.png) The **Output** tab of the **Pattern Properties** dialog contains the following elements. | Property | Description | | --- | --- | | **Progress** | The height that is reserved for the output of any rearranges belonging to the pattern. It effectively controls where the rearranges for the next pattern are placed so that they flow downwards on the output page. The Y position of rearranges belonging to a pattern are always relative to the current page progress. A progress of **5.0** means that the output of the next pattern match is placed 5 millimeters lower than the current pattern match. | | **Progress is relative to the highest rearrange** | Defines the **Progress** value as the size of the vertical margin between the output rearranges of each pattern match instead of using an absolute progress for the pattern. This setting implies that rearranges within a pattern can have differing heights and positions, and calculates the total progress accordingly. > [!NOTE] > Note > > For script output to be used for relative progress calculations, the scripts must be run as the first pass. See [Add Dynamic Elements to a Sheet](/v1/docs/add-dynamic-elements-to-a-sheet). | | **Group until** | Creates a group starting at every instance of the current pattern and ending with any pattern available in the list (like the OR expression). This setting is related to the **Keep rearranges together** setting (see below); if the **Keep rearranges together** checkbox is selected for the group starting instance, Lasernet Core does not add implicit page breaks until the ending group instance. Once the check box is selected, a grid containing patterns and command buttons to manipulate those patterns appear. By default, the current pattern is listed here. Clicking the **Add** command button adds one more current pattern to the grid. To change it to a new one, select the pattern and click the **Edit** command button, or double-click the pattern. Afterwards, select the required pattern among those available in the drop-down list. To remove the pattern from the grid, select it and click the **Remove** command button. Each matching pattern except the current one can be included or excluded by acquiring the **Yes** or **No** value, respectively. Patterns with the **No** value do not end the group. The last pattern before the **No** value pattern ends the group instead. | | **GroupName** | Type a descriptive name for the group. | | **Additional progress** | Defines the space size between group blocks. | | **Keep rearranges together** | If the checkbox is selected, Lasernet Core keeps all the lines of the rearranges for a pattern together on the same page. If the checkbox is cleared, Lasernet Core does not keep all rearranges in a pattern together on the same page. | | **Remove empty lines from beginning of each page** | If the checkbox is selected, empty pattern lines are removed from the top of each page in the output. | | **Remove empty lines from end of each page** | If the checkbox is selected, empty pattern lines are removed from the bottom of each page in the output. | | **Widow/orphan control** | If the checkbox is selected, Lasernet Core avoids putting one or more paragraph-ending lines at the top of a page (widows) or leaving one or more paragraph-starting lines at the bottom of a page (orphans). You can set a number of lines to be considered widow/orphan. | | **Page break before** | If the checkbox is selected, a page break is inserted before each pattern output (instance). If a group is specified (see **Group until**), selecting the checkbox will insert a page break before each group block. | | **Page break after** | If the checkbox is selected, a page break is inserted after each pattern output (instance). If a group is specified (see **Group until**), selecting the checkbox will insert a page break after each group block. | | **Output Area** | From the drop-down list, select an output area to display the pattern. The list contains the default conditional area and custom conditional area(s), if added. Select the **** option to connect the pattern to the same conditional area as the previous pattern. If the first line of the conditional area is recognized as a pattern with the value, it will be processed in the same way as the default conditional area. | | **Output Region** | Select the [region](/v1/docs/position-elements-in-specific-areas-of-a-sheet) where the pattern should be displayed in the output. The list contains the default region and custom regions(s), if added to a defined conditional area. | ## Alternating Tab ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/pattern 7.png) The **Alternating** option comes into effect only when a table is added to the output. You can specify the table settings, including the color of odd/even rows (defined by instance(s) of a pattern), among other things (for more details, see [Add Tables to a Sheet](/v1/docs/add-tables-to-a-sheet)). There is a pattern instance for every pattern match in the input (represented in the output by object instances added to the pattern). See the table below to learn more about the controls available on the **Alternating** tab of the **Pattern Properties** dialog. | Property | Description | | --- | --- | | **Detect pattern** | Use the drop-down list to select one of the options you need: **Odd/Even**: Select the option to alternate all available instances belonging to a pattern as odd and even. **Odd/Even but not in the Same Pattern:** Select the option to alternate the current instance as odd and even but only if the previous one belongs to another pattern. **Same As Previous Pattern:** Select the option to keep instances without alternating. |