-4

So I have this string:

Number of results that have been found: 152
result1
result2
result3
result4
...
...

I want to match everything after found: 152, but the 152 could be 1, or 10 or 100 or 1000. I do not know in advance. The current regex that I have matches everything that I want, but the problem is it includes the number, which I do not want.

The regex:

(?<=found: )[.|\n|\W|\w]*

Does anyone know how I can exclude the number after found: or do I have to filter this in my code

user438383
  • 4,338
  • 6
  • 23
  • 35
Coder
  • 61
  • 5

1 Answers1

0

What about (?<=found: \d+)\n[\n|\W|\w]*?

Fundamentally, I've included \d+ in the lookbehind for matching the digits.

Enlico
  • 17,834
  • 5
  • 39
  • 78
  • 1
    No that does not do the trick unfortunately – Coder May 29 '22 at 13:02
  • @Coder, how doesn't it do? This regex matches exactly everything after the `152` number of the first line. Isn't that what you asked? _I want to match everything after found: 152_. – Enlico May 29 '22 at 14:39