I have python string and contents are shown below:
Using '/tmp' as temporary location
GNU gdb (GDB) 8.3.0.20190826-git
Copyright (C) 2019 Free Software Foundation, Inc.
Type "show copying" and "show warranty" for details.
(gdb) #0 snp
#3 0x081fc9bc in main (argc=<optimized out>, argv=0xffffde44) at ../../../../../../.
(gdb) quit
jdebug version: 5.0.1
[File is compressed. This may take a moment...]
The only part i want to retrieve is every thing between (gdb) -to- (gdb)quit
Meaning, final out put i am looking is:
(gdb) #0 snp
#3 0x081fc9bc in main (argc=<optimized out>, argv=0xffffde44) at ../../../../../../.
(gdb) quit
Python code which is not working:
with open('st.txt', 'r') as file:
data = file.read()
print(re.search(r'(gdb).*(gdb) quit', data))
Any idea how can i extract this string using correct regular expression?