-1

I have something like below

Payment Instrument modified. payment no: 5000000000000000, method: C for transponder: 5000000000000000 transponder type: A

In the above my regex need to match only 5000000000000000 which appeared after payment no:

Pattern: ([payment no: ][0-9]{4}[0-9]{0,16})([0-9]{4})

Manivelpvn
  • 13
  • 2

1 Answers1

0

You can use the RegEx (?<=payment no: )\d+

  • (?<=payment no: ) makes sure there is payment no: before your match

  • \d+ matches any digit 1 or more times.


A version without the lookbehind would be payment no: (\d+)

Demo.

Zenoo
  • 12,670
  • 4
  • 45
  • 69