Regex find anything before string XY

Hello Guys,

First: Thanks for helping so fast all the time!
I got another Regex Problem:
In the attached file I want to find the number 155987 it’s always followed by a -ÜZ and always 6 digits.
How do I find it?
Thanks!

Einzahlungen.txt (345 Bytes)

.*(?=-ÜZ)

As @Pradeep_Shiv said you can use \d{6}(?=- ÜZ)

1 Like

Yes
@srdjan.suc

if its working fine mark this as a solution and close this thread @SSchmitz

@SSchmitz:

You can also try (?<=-UZ).*

or for specific digit
((?<=-UZ)\d{6})
or for your data
\d{6}.*(?=-UZ)

it’s going to give him the forward value of a string

Hey Guys, Only with image i get a solution. But I want to make sure only 6 digit numbers are grabbed. Thanks!

1 Like

Then use the one that I posted.

Hi @SSchmitz,

Try this,

(?<=(\n|\s))\d{6}(?=-ÜZ)

This will fetch only 6 digit numbers…!

regex6DigitNum.xaml (7.0 KB) Einzahlungen.txt (345 Bytes)

Thanks!

1 Like

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