Hello,
I'm pretty new to Python.
Can someone please show me how to find a number between 2 regular expressions?
Something like this:
Text:
' MyText (mymessage): 0 (Time 0 hours)'
' MyText (mymessage): 344 (Time 34 hours)'
' MyText (mymessage): 1000 (Time 2000 hours)'
I'd like to "grep" for:
0
344
1000
And then later grep for:
0
34
2000
But am sure I will manage the second one when I can figure out how to do the first one.
I've played with the "re" function, but the output looks like this:
[' 0 ']
And I can't figure out how to get rid of the white space and quotes. The plan is to get the integer and compare that with another integer.
Thank you
I'm pretty new to Python.
Can someone please show me how to find a number between 2 regular expressions?
Something like this:
Text:
' MyText (mymessage): 0 (Time 0 hours)'
' MyText (mymessage): 344 (Time 34 hours)'
' MyText (mymessage): 1000 (Time 2000 hours)'
I'd like to "grep" for:
0
344
1000
And then later grep for:
0
34
2000
But am sure I will manage the second one when I can figure out how to do the first one.
I've played with the "re" function, but the output looks like this:
[' 0 ']
And I can't figure out how to get rid of the white space and quotes. The plan is to get the integer and compare that with another integer.
Thank you
Comment