python regex cheatsheet


find string between characters


(?<=This is)(.*)(?=sentence)


I used lookbehind (?<=) and look ahead (?=) so that "This is" and "sentence" is not included in the match, but this is up to your use case, you can also simply write This is(.*)sentence.


Leave a Reply

Your email address will not be published. Required fields are marked *