import re


def get_vocabs_from_string(string): 
    """
    Search in the string to find BODC vocabularies (P01, P06 etc. 
    Returns a dict where: 
        key = vocabulary 
        value = code 
    """
    result = re.findall('SDN:[A-Z0-9]*::[A-Z0-9]*', string) 
    vocabs = {}
    for item in result: 
        split_item = item.split(':')
        vocabs[split_item[1]] = split_item[3]
        
    return vocabs