Here is the sample text:
initiated to address the deviation to SOP-020583v11.0 Section SOP-016248v2.0 john doe, john doe SOP-020583 fake text, this is all fake
Ideally, the text would look like:
initiated to address the deviation to 020583 Section 016248 john doe, john doe 020583 fake text, this is all fake
Here is the code I have so far:
def dashrepl(matchobj):
print (type(matchobj))
return re.findall('[0-9]',matchobj)
re.sub(SOP, dashrepl, long_desc_text[22])
But I'm getting the following error:
TypeError: expected string or buffer
Edit updated content:
long_desc_text[22]
SOP-020583v11.0 Section 8.4.On 17Jan2016 at ATO Site, SOP-016248v2.0 was due for periodic review but the periodic SOP-016248 revision is not tied to any change control records. SOP-020583 tied to a change control record" and notified ID63718 notifiedID22359 of the event. SOP-020583v11.0, fake text fake text