Search code examples
sublimetext3

Sublime Text 3 Regular Expression (Line jump)


I would like to select a specific text on Sublime text, I looked for tutorials on how to do it but I can't find what I want.

As you can see on the screen, I'd like that from a word, for example "hello", it selects the sentence where there is the word but also the 2 sentences underneath.

Is it possible to do this?

Screen Example

in red represents the selection


Solution

  • I think you are using the word 'sentence' when what you mean is a 'line' and what you want to do is to construct a RegEx to select the line a specific word is on and also the contents of the next 2 lines.

    If that is right then the following regex does what you want and seems like what is shown in the screenshot that you posted.

    (hello)(.*\n){2}(.*)