from typing import List


def extract_fields(rec: str, pos: List[int]) -> List[str]:
    """ Extract fields from a delimited record """

    fields = []
    if length := len(rec):
        for i in pos:
            if i < length:
                fields.append(rec[i])

    return fields