Mar-04-2024, 09:07 PM
Greetings!
I’d like to match strings in files, it seems simple but I’m failing to do this…
It has multiple white spaces before the word Start Time or End Time and the Time and Date of the event
I tried :
And got an error message “ bad escape \T at position 11”
Then I tried:
This one prints tons of other lines I do not care about.
I was sure by using “\s+” would filter the line I wanted but it does not.
Would you help me with this?
Thank you.
I’d like to match strings in files, it seems simple but I’m failing to do this…
It has multiple white spaces before the word Start Time or End Time and the Time and Date of the event
1 |
String “ Start Time 2 / 28 / 2024 8 : 34 : 34 AM ” |
1 2 3 |
if re.search( "\s+\Start\s\Time" ,el) : # < ------------- el is a line from the file ,,, print ( f " START LN {el}" ) |
Then I tried:
1 2 |
if re.search( "\s+\Start\s\" ,el) : # < ------------- el is a line from the file ,,, print ( f " START LN {el}" ) |

I was sure by using “\s+” would filter the line I wanted but it does not.
Would you help me with this?
Thank you.