-1

the example sentence is:

"Thanks to this crisis, there has been a wake-up call to some of these neobanks," said Ali Niknam, CEO and founder of Dutch online 
bank Bunq. "To run a healthy business, you need healthy business conduct."

and my regex is

(said)\s.*,\s(CEO and founder of)\s.*\.

I am expecting it to match to

said Ali Niknam, CEO and founder of Dutch online 
bank Bunq.

but it does not due to the break after the word online. is there a way to make it work without modifying the sample text?

anubhava
  • 761,203
  • 64
  • 569
  • 643
Moblize IT
  • 1,140
  • 2
  • 18
  • 44

1 Answers1

0

See here: https://regexr.com/5jms2.

  1. . doesn't include line breaks. You can use (.|\n) instead.
  2. * is greedy by default. Using *? makes it non-greedy, i.e. it matches the minimum amount of text until the next expression is matched (in this case- \.).
ItaiS
  • 106
  • 8