I got a wrong log as:
test_string = """
03/27/17 12:55.23something wrong with 20405 post id 450469503/27/17 12:50.55something
wrong with 20302 post id 450180903/27/17 11:41.18something wrong with 18314
post id 443624203/27/17 11:26.56something wrong with 17922 post id 442210904/27/17 10:48.33
something wrong with 16775 post id 438259104/27/17 10:30.59something
wrong with 16275 post id 436333705/27/17
"""
I want to get the exact post id after "post id ", but not the datatime information. soltion:
import re
test_string = """
03/27/17 12:55.23something wrong with 20405 post id 450469503/27/17 12:50.55something
wrong with 20302 post id 450180903/27/17 11:41.18something wrong with 18314
post id 443624203/27/17 11:26.56something wrong with 17922 post id 442210904/27/17 10:48.33
something wrong with 16775 post id 438259104/27/17 10:30.59something
wrong with 16275 post id 436333705/27/17
"""
regex = r'(?<=post id\s)(\d*)(?=\d\d/\d\d/\d\d)'
re.compile(regex).findall(test_string)