Some cases, I have to replace/delete lines starts with particular word like \'public\' \'private\' Java classes or for XML file.
Use the following regular expression to hide lines starting with 'public' -
Regex Line Replacement
public(.*)\R
Eclipse Config
Example