Using regex to extract a specific paragraph

so i have this pdf invoice that contains more than one order and i want to use regex to extract the text that starts with “please deliver to:” and ends with an empty line, EMPTY LINE NOT A WHITE SPACE.

the expression i used is

“(?<=Please deliver to:\s\n)((?:.+\s)*)”

but that doesn’t to seem right, it is selecting the fist word correctly and then selecting everything after that. However, i want it to match until the first empty line after this starting expression “(?<=Please deliver to:\s\n)”

any solution?


do you have an example of the full text? like please delivery to 12 Hp street…

i just want to see what an empty line looks like as you call it.

This for example: (?<=Please deliver to:\s)(.{1,}) would match the entire line until the new or next line