# GetMatchRegEx (StartAt)

| **Name**    | ***GetMatchRegEx***                                                                                                                                                                                                 |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax      | GetMatchRegEx (String pattern, String str, Integer startAt)                                                                                                                                                         |
| Purpose     | To return a result if a match was found. Otherwise, returns an empty string.                                                                                                                                        |
| Description | Scans the string, starting at the specified (interger) position, for an occurrence of text matching the specified regular expression.                                                                               |
| Return Type | String                                                                                                                                                                                                              |
| Parameters  | <p>pattern \[System.String] – Regular expression pattern to match</p><p>str \[System.String] – String to search for a match</p><p>startAt \[System.Int64] – The character position at which to start the search</p> |

![](/files/Ahi9rDrd6mLEwDlvcfWS)

**Example**

In this example, we will pass the required parameters to the function transformation object using a *Variables* object.

Where,

*Regular Expression (Pattern)* = ^H\[\S]{0,4}|$

*String* = 1234HelloWorld!

*startAt* = 4

{% hint style="info" %}
**Note:** The specified regular expression will look for and match a string which begins with “H” (case sensitive). Next, it will match any character that is not a whitespace character in the next 0 to 4 characters. Finally, the “$” is used to end the string. Therefore, the returned output should be “Hello”, as the *startAt* position is “4”.
{% endhint %}

![](/files/RRgHQ7GcTdRRl6jGxV6q)

In the output window, you can see that Astera has returned a string value, as the regular expression pattern has been matched in accordance with the defined starting position.

![](/files/KmSnAu82v5Tjo15NAoQF)


---

# 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-v10/functions/regular-expressions/getmatchregex-startat.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.
