Regex to get number patterns according to conditions

Good morning friends;

One query please, I am making a regex to capture the transaction number of the vouchers, but something is wrong in my regex:

(?<=OP-[\d+])|(?<=NO.OP [\d+])|(?<=Número de operación [\d+])

I am using the words before the operation number;

OP-
NO.OP
Número de operación

The data captured is 6 vouchers, only in the third voucher the operation number appears before the keyword

I have highlighted in yellow the operation numbers

Regex and data:

How about this:

(?<=OP-)[\d]+|(?<=NO\.OPE: )[\d]+|(?<=Número de operación )[\d]+|[\d]+(?= NO\.OPE :)

Cheers

1 Like

Thank you @J0ska :slight_smile:

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