C
charonzen
I have a list of strings. These strings are previously selected
bigrams with underscores between them ('and_the', 'nothing_given', and
so on). I need to write a regex that will read another text string
that this list was derived from and replace selections in this text
string with those from my list. So in my text string, '... and the...
' becomes ' ... and_the...'. I can't figure out how to manipulate
re.sub(r'([a-z]*) ([a-z]*)', r'(????)', textstring)
Any suggestions?
Thank you if you can help!
bigrams with underscores between them ('and_the', 'nothing_given', and
so on). I need to write a regex that will read another text string
that this list was derived from and replace selections in this text
string with those from my list. So in my text string, '... and the...
' becomes ' ... and_the...'. I can't figure out how to manipulate
re.sub(r'([a-z]*) ([a-z]*)', r'(????)', textstring)
Any suggestions?
Thank you if you can help!