Hello, Manorma Gautam,
Not very difficult !
From what you said, I deduced some points :
You want to keep the lines, which contain, either, the string vprn OR vpls
These two words begin by the two lowercase letters vp
These two words are always located at beginning of lines
All the lines, which do not contain these two words, must be deleted
So, follow the few steps, below :
Move back to the very beginning of your file ( Ctrl + Origin )
Open the Replace dialog (Ctrl + H )
In the Find what zone, type in (?-is)^(?!vp).+\R
Leave the Repalce with zone EMPTY
Uncheck, preferably, the Wrap around option
Select the Regular expression search mode
Click on the Replace All button
Et voilà !
NOTES :
The first part of the regex are in-line modifiers (?-is) to force the regex engine to consider the search :
In a non-insensitive way ( in the case you, previously, unchecked the March case option
With the dot symbol matching standard characters, exclusively, in the case you, previously, checked the . matches newline** option
The middle part ^(?!vp) looks, from beginning of each line, for a negative look-ahead ( a condition that must be true in order to satisfy the overall match but which is not part of the final regex. So, it verifies, for each line, if the exact string vp does NOT occur, at beginning of lines. If it’s the case :
The last part, of this regex, .+\R matches any non-null range of standard characters, from beginning of line, followed by any kind of EOL characters. That is to say any complete line, which does NOT begin with vp
All these complete lines are, of course, deleted, as the replacement part has been left EMPTY
REMARK : The important thing, to note, is that look-arounds ( look-behinds and look-aheads ) do NOT move the regex engine position of search. So, after evaluating the negative look-ahead (?!vp) , the regex engine position is, still, just before the first character of each line ! Therefore, the part .+ does match all the standard characters of each line !
Best Regards,
guy038