# Collection of code snippets by Arne Vajhøj 
# (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import re

s1 = 'Aaaa Bbbb - Ccccc Ddddd'
m = re.match('(.*) -.*', s1)
if m:
    s2 = m.group(1)
    print('|' + s2 + '|')
else:
    print('No match')
