Delete Specified Lines in Vim

Delete all lines that includes string pattern
g/pattern/d

Delete all lines that does not contain string pattern
g!/pattern/d
v/pattern/d

dx deletes x lines,for example:
:100,1000g/hello/d2, deletes two lines which includes string hello between 100 and 1000 line