import re


def get_nterminal_softclip(cigarstring):
    """
        Extracts the N-terminal softclipping parameter from a cigar string. Reports softclipping as an integer.

        Args:
            cigarstring (str): cigar string from an aligned sequence

        Returns:
            five_clipping (int): the number of bases from 5' of  raw sequence that was stripped for alignment
    """
    five_clipping = re.search(r'^(\d+)(?=S)', cigarstring)
    return int(five_clipping.groups()[0]) if five_clipping else 0