0

In search expressions I know I can find the shortest match on line with the following expression:

begin.\{-}end

So for example, if the text is like this:

begin end1 end2 end3

Then it will match up to the "1". However, what if the text is spread over multiple lines like this:

begin blah blah blah
blah blah blah end1 end2 end3

How do I do the same match across the end of line?

1 Answer 1

2

try /begin\_.\{-}end

\_. Matches any single character or end-of-line.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.