> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.groupalarm.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Configure Flow: Text Parser

# Configure Flow: Text Parser

To be able to use values contained in a text as variables in the flow, you need the text parser. 
With this, you can search directly for a so-called "key" and save the subsequent text of the same line as a variable.

The basic functioning is explained with the following text:

`Hello GroupAlarm,

I would like to trigger an alarm with the following parameters:
Event: TESTALARM
Alarm text: ***TEST*** Do not move out!
LONG##50.76382
LAT##6.0793028
Address: Goethestraße 5, 52064 Aachen, Germany #

All subscribers are to be alerted.`

Basically, the configured key is searched for within the text and removed from the found line, so that only the value behind it is stored. Therefore, if your key contains a `:`, it must be specified in the key.

Below are some examples applied to the above text that produce the following results:

| Syntax | Result |
| --- | --- |
| Event: | TESTALARM |
| Event | : TESTALARM |
| LONG### | 50.76382 |


With _Expert Mode_, [regular expressions](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/RegExp) can be applied to the text. 
This allows you to search even more specifically for values within a text. To do this, use at least one regex group that is to be matched, as the text parser can only ever extract the **first** group found. 

||| If the parser does not match a group, your variable will not contain a value.

For example, the RegEx `Address(.*)#` can be used to extract the address "Goethestraße 5, 52064 Aachen, Germany" from the text above without a leading key and `#` at the end.

In addition to the actual regular expression, you can also configure [RegEx flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags_2) for an advanced search. The following flags are currently available:

| Flag | Name | Description |
| --- | --- | --- |
| `i` | insensitive | ignores upper and lower case spelling |
| `m` | multi line | Treats the search context as multiple lines, i.e. `^` and `$` are the beginning and end of each line |
| `s` | single line | `.` also indicates a new line | 
| `U` | ungreedy | the shortest possible string is used | 
