Hackerrank regex solution
Single-character variable names when used outside of 'traditional' loop constructs (e.g. i, j) or lambda bodies are bad not recommended, U(ppercase) case ones especially more so as they can get easily be confused with class names or generic type declaration (the usage most often seen). Therefore, please give better names to Matcher M and int T.

public static boolean doesTagEndInTheSameLine(String remainingHtml){
    Matcher endingOfTag = rgxForTagAtStart.matcher(remainingHtml);
    Boolean B = endingOfTag.find();
    return B;
}


I think a primitive boolean will do here. The whole method body can be simplified to just:

public static boolean doesTagEndInTheSameLine(String remainingHtml) {
    return rgxForTagAtStart.matcher(remainingHtml).find();
}


One more thing: You can do with more white spaces between operators...