code: protected static String grep(String selector, String text) {
  		if (text == null || text.isEmpty()) {
  			return null;
  		}
  		final StringBuilder line = new StringBuilder();
  		final int textLength = text.length();
  		char c;
  		String string;
  		for (int i = 0; i < textLength; ++i) {
  			c = text.charAt(i);
  			if (c == '\n' || c == '\r') {
  				string = line.toString();
  				if (string.contains(selector)) {
  					return string;
  				}
  				line.setLength(0);
  			} else {
  				line.append(c);
  			}
  		}
  		if (line.length() > 0) {
  			string = line.toString();
  			if (string.contains(selector)) {
  				return string;
  			}
  		}
  		return null;
  	}
docs: Replies the first line that contains the given selector.
  
  @param selector is the string to search for.
  @param text is the text to search in.
  @return the found line or <code>null</code>.