I have extracted some text data from word document(.doc) and stored in a variable my_text
such that
my_text[2] = '2 Running Hrs - \tPort M/E RPM \t- \t'
here \t is the delimiter from the document itself.
I'm trying to extract word/character between a word 'Running Hrs' and '\t' a delimiter.
So that I would get an output '-'
Here I tried
- Trial 1
import re
re.search('Running Hrs(.*)\t', my_text[2].strip()).group(1)
Output
' - \tPort M/E RPM '
- Trial 2
print(re.findall(r'\Running Hrs([^]\t*)\]', str(my_text[2])))
output
ERROR: error: bad escape \R
Any suggestion on this.