def rowMatch(df, col,rex,addedSpec="(?i)"):
    """
       Select rows in a DataFrame using a regular expression as mask. The 
       difficulty is that we may need to work with NA/NaN which are not
       allowed in masks
    """
    msk = df[col].str.contains(rex+addedSpec)
    try:
       ret = df[msk]
    except Exception as err:
        # print(f"got into exception  {err}, type(msk) ={type(msk)}")
        # display(msk)
        msk[msk.isna()]=False
        ret = df[msk]
    return ret