import re


def get_cell_barcode(record, cell_barcode_pattern):
    """Return the cell barcode in the record name.

    Parameters
    ----------
    record : screed record
        screed record containing the cell barcode
    cell_barcode_pattern: regex pattern
        cell barcode pattern to detect in the record name
    Returns
    -------
    barcode : str
        Return cell barcode from the name, if it doesn't exit, returns None
    """
    found_cell_barcode = re.findall(cell_barcode_pattern, record['name'])
    if found_cell_barcode:
        return found_cell_barcode[0][1]