Let's say I'm trying to match /dog.*lab/this text:
"I have a dog. My dog โโis a black laboratory. It was created in a laboratory."
Tough, it will fit "a dog. My dog โโis a black laboratory. It was created in a laboratory."
I want to find matches that are narrowest on both sides. If I use the ungreedy modifier, for example,
/dog.*?lab/or /dog.*lab/Uit will be smaller, but still too much:
"Dog. My dog โโis a black laboratory"
Is there a way to make my search jagged on the left too, thus matching only โdog is a black labโ?
Many thanks. Sorry for the far-fetched example.
source
share