# Defining Region End Type as Specific Text and Regular Expression

*Region End Type* options are useful for defining where to end a particular data region. This option appears in the *Region Details* group box in the *Region Properties* panel. There are several options to define the end type of a region.

![](/files/pBdXzmcfZDy8TUL72YDM)

In this article, we will discuss the use of *Till Regular Expression* and *Till Specific Text* options.

Click [here](/astera-data-stack-v9/report-model/report-model-interface/region-properties-panel.md) to learn more about the rest of the options.

## **Sample Use-Case**

In this case, we have an invoice containing details of the dealer, Global Cars, and the list of vehicles available for purchase. This is what the data looks like:

![](/files/7hAyPkBgmuRQNquhyVpP)

Here, we want to extract the dealer’s information by defining the end type of data regions using the *Till Regular Expression* and *Till Specific Text* options.

## **Steps to Create a Report Model**

1. Go to *File > New > Report Model* and load the unstructured document in a new report model. This is how the file looks like in the Report Model designer.

![](/files/bJpWcqxBMGk2Jh9MohgT)

2. Add a new data region to the Model Layout panel by right-clicking on the *Record* node and selecting the first option from the menu.

![](/files/7ZjvW5RfcbSiy1u9rtaK)

3. Define a pattern in the orange bar above the designer to capture the first line of the region. In this case, we are using “DEALER NAME” as the pattern.

![](/files/prII0GdRZzpwggcw5VRK)

{% hint style="info" %}
**Note:** Make sure the pattern is vertically aligned with the data on the canvas.
{% endhint %}

4. Here, only the line containing the pattern is a part of the region. Let’s use the *Till Specific Text* option to define the end type of the region in the Region Properties Panel.

![](/files/jqvlbR1EENYfIhmy6H3P)

We have used “EMAIL” as the specific text to capture all the lines until line 14.

The *Line Count* option determines the minimum number of lines for the region. Astera looks for the specific text or regular expression after a set number of lines (defined by *Line Count*) from where the pattern is matched.

{% hint style="info" %}
**Note:** *Line Count* takes precedence and determines the end-point of the region when the specific text or regular expression is not found in the document.
{% endhint %}

5. Now, the entire data region, starting from where the pattern is matched till the specific text, highlighted by a grey area, has been captured.

![](/files/KnL6rRQXLayho8wjYKOg)

6. Alternatively, you can also specify a regular expression to define the end type of the region. Here, we have selected *Till Regular Expression* from the *Region End Type* drop-down menu and specified a regular expression to define the format of the email.

![](/files/yQHtV6B3f3cGx5S4tXKP)

7. Now, create data fields in this region to capture all the required information.

![](/files/056dfYe8NYRwf4LVfwuO)

8. You have successfully created a data region and extracted relevant data fields containing the dealer’s information.

![](/files/ucVHNxJ0o1B5CeTjtXrS)

This is how you can capture data regions using the *Till Specific Text* and *Till Regular Expression* options as the *Region End Type.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.astera.com/astera-data-stack-v9/report-model/use-cases/defining-region-end-type-as-specific-text-and-regular-expression.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
