import re


def convert_re_groups_to_noncapturing(re_str):
    """Convert groups in a re string to noncapturing.

    Adds ?: to capturing groups after the opening parentheses to
    convert them to noncapturing groups and returns the resulting re
    string.

    """
    return re.sub(r'(?<!\\)\((?!\?)', '(?:', re_str)