Hi,

example of my string

1234 test TEST 1234567

from here I need to get 5 digits. Normally the second number has 5 digits, but it happenes that is has more. Then I would need to get first 5 digits from it.

Can you help me here?

Hi,

example of my string

1234 test TEST 1234567

from here I need to get 5 digits. Normally the second number has 5 digits, but it happenes that is has more. Then I would need to get first 5 digits from it.

Can you help me here?

Hi @camaro123

Check the below assign syntax:

```
Input = "1234 test TEST 1234567"
Output = System.Text.RegularExpressions.Regex.Match(Input,"\b\d{5}").Value.Trim()
```

Hope it helps!!

Hi @camaro123

Please try using the regex to extract the data.

**Regex**

```
\b\d{5}
```

**\b** - represent the boundary of the text

**\d** - represent the number format in regex

**\d{5}** - represent the 5 number to get conjugative

**\b\d{5}** - represent get only the boundary of the 5 digit number.

UiPath Code using **Assign Activity**:

```
number = System.Text.RegularExpressions.Regex.Match(myinput,"\b\d{5}").Value.Trim()
```

Thanks,

Purushotham