Wrap string at certain delimiters The method receives an unformatted string and it needs to put line breaks after ';' or before 'i)' and 'i.', where i - integer. 
If received a string like '; 1)', then it should add only one line breaker after ';' and before '1)'.

// This is ugly - needs to be refined and refactored
private static String format(String unformattedStr) {
    Pattern p1 = Pattern.compile("(\\;\\s*)");
    Matcher matcher1 = p1.matcher(unformattedStr);

    String formattedStr1;
    if (matcher1.find()) {
        formattedV1 = matcher1.replaceAll("$1\\\\n");
    } else {
        formattedV1 = unformattedStr;
    }

    Pattern p2 = Pattern.compile("(\\d+\\)|\\d+\\.)");
    Matcher matcher2 = p2.matcher(formattedV1);
    String formattedV2;

    if (matcher2.find()) {
        formattedV2 = matcher2.replaceAll("\\\\n$1");
    }
    else {
        formattedV2 = formattedV1;
    }

    String formattedV3 = formattedV2.replaceAll("\\\\n\\s*(\\\\n)+", "\\\\n");
    return formattedV3;
}
It looks like you have three distinct cases, two of which can be covered with one regex as @EmilyL pointed out already.

So unless I am missing something can't you just do the following?

private static String format(String unformattedStr) {    
    return unformattedStr.replaceAll("(;?\\s)(\\d+[).])", "$1\\\\n$2");
}