You probably want `.replace(/\/+$/,'')` for dates like "2013///", which are common in RIS (unless that doesn't happen for LN). OTOH, you can also just `.replace(/^PY\s+-\s+/mg, 'DA  - ')` above (unless DA and PY can exist in the same RIS, in which case, what you have is safer)