Suppose I have two paragraphs while reading a file:
'Baa, baa, black sheep, have you any wool?
Yes sir, yes sir, three bags full!
One for the master
One for the dame'
'Mary had a little lamb,
its fleece was white as snow;
And everywhere that Mary went,
the lamb was sure to go.'
Is there any code (using regular expressions or something) that, if I search 'lamb'
, will select the entire second paragraph?
Assuming that the paragraphs are all in a single string, something like this should work: