import re


def regex_or_str(termslist: list):
    """Joins items of a list with the regex OR operator
        Getting terms of the list into str for regex with OR |

    Args:
        termslist (list): list of terms (strings) that should be joined
            with the | operator.

    Returns:
        re.Pattern: the regex pattern in unicode
    """
    regex_terms = ''
    for item in termslist:
        if item == termslist[0]:
            regex_terms += "\\b"
        regex_terms += item
        if item != termslist[-1]:
            regex_terms += "\\b|\\b"
        else:
            regex_terms += "\\b"
    # raw_regex_terms = r"{}".format(regex_terms)
    return re.compile(regex_terms)