I have a dataframe that looks like
LineEntry: [0x0000000002758261-0x0000000002758268): /a/b/c:7921:14
LineEntry: [0x0000000002756945-0x0000000002756960): /f/b/c:6545:10
LineEntry: [0x00000000027562c9-0x00000000027562d0): /k/b/c
LineEntry: [0x00000000027562c9-0x00000000027562d0): /c/d/f
....
....
I am interested only in strings that look like the first two entries( i.e 5 strings after before and after colon delimiter) and extract the last two strings before and after last colon ( Ex:7921, 14)
After filtering above, the dataframe should like
LineEntry: [0x0000000002758261-0x0000000002758268): /a/b/c:7921:14
LineEntry: [0x0000000002756945-0x0000000002756960): /f/b/c:6545:10
I have tried
res = re.split(":", df ) and use res[3] and res[4]
to extract last 2 strings before and after colon , but I get errors for 3 and 4th type of lines as above.
Any effective ways of filtering dataframe entries that exactly looks like the first two line entries?