Reputation: 3054
Why is the result 'bc' and not 'abc'?:
>>> import re
>>> re.sub('-\n([a-z])', '','-\nabc',re.M)
'bc'
Upvotes: 0
Views: 9765
Reputation: 5509
You can just specify the string to be replaced:
re.sub('-\n', '','-\nabc')
will return just the abc
Upvotes: 1