Regex - Get text after a specific pattern

Dear all :),

I am trying to get from this text until the amount combination:

KNAB351AAMT820219 Picanto 1.2 DPI GT Line 5pl -Naveg-Adv 11.471,16

I mean, this is what I want: KNAB351AAMT820219 Picanto 1.2 DPI GT Line 5pl -Naveg-Adv.

How can avoid 11.471,16?

I have more lines like this with different amounts.

Thanks :slight_smile:

@Angel_Llull - Please try like this…

 .*[^\d.,]+

System.text.regularexpressions.regex.match("YourString",".*[^\d.,]+").tostring.trim
1 Like

Hello @prasath17 ,

Thanks for the reply! I forgot to tell that this sentence is inside an invoice…
image

I tried what you said and it is matching this…

@Angel_Llull - Can you please share couple of lines with amount field on it?

Yes of course:

Unitario
KNAB351AAMT820219 Picanto 1.2 DPI GT Line 5pl -Naveg-Adv 11.471,16

Tipo G6S6K7615 *Pack Estándar 77,00
*Extra Kit 0,00
Grado G *Pintura 147,11
Version GGN8 *0,50% Publicidad Picanto 1.2 DPI GT Line 5pl -Nav 58,48
Color UD 11.753,75
*Campaña 0,00
*Transporte 364,50

Sub Total 12.118,25

IVA 21,00 % 2.544,83

@Angel_Llull - Is this the output you are looking for??

1 Like

Thanks! :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.