
    Given a delivery route identifier containing both primary segments (in uppercase) and optional detour segments (in lowercase), create a function that extracts only the primary route segments by removing all lowercase portions. The resulting route identifier should represent the main delivery path without any conditional detours or temporary segments.
    

    
import re

def remove_lowercase(str1):
    """
    Given a delivery route identifier containing both primary segments (in uppercase) and optional detour segments (in lowercase), create a function that extracts only the primary route segments by removing all lowercase portions. The resulting route identifier should represent the main delivery path without any conditional detours or temporary segments.
    

    """
import re

def remove_lowercase(str1):
    """
    Given a delivery route identifier containing both primary segments (in uppercase) and optional detour segments (in lowercase), create a function that extracts only the primary route segments by removing all lowercase portions. The resulting route identifier should represent the main delivery path without any conditional detours or temporary segments.
    

    """
    return re.sub('[a-z]', '', str1)