0

I have the following string:

foo
 1
 2
 3
 bar
!
!
 2
 3
 bar
!

And I would like to match:

foo
 1
 2
 3
 bar
!

My current regex is (?s)foo.*! , but that matched everything

Here is my regex example:

https://regex101.com/r/MBbHnr/1

David
  • 105
  • 1
  • 10

0 Answers0