def replace_pcell_layers(pcell_script, layer_mapping):
    """Replace PCell layer tags with process layer names from layer mapping
    
    Parameters
    ----------
    pcell_script : str
        Python PCell script.
    layer_mapping : dict
        Mapping of layer tags from PCell scripts to process layers from Process
        YAML.

    Returns
    -------
    pcell_script : str
        PCell script with layer tags replaced by process layer names

    """
    
    # Find {Layer} tags
    substring_len = len('{Layer}')
    tag_ind = 0

    while pcell_script.find('{Layer}') != -1:
        start_layer_tag_ind = pcell_script.find('{Layer}', tag_ind) - 1
        tag_ind = pcell_script.find('{Layer}', tag_ind) + substring_len
        end_layer_tag_ind = pcell_script.find('}', tag_ind)
        entire_tag = pcell_script[start_layer_tag_ind:end_layer_tag_ind + 1]
        layer_name = pcell_script[tag_ind:end_layer_tag_ind]
        
        process_layer_name = layer_mapping.get(layer_name).split(' - ')[0]
        pcell_script = pcell_script.replace(entire_tag, process_layer_name)
    
    return pcell_script