Im looking for a way to copy a specific part out of a mail body. The part always begins and ends with the same word but the content is different. E.g.:
Hello Mr. X,
Im doing well.
StartWord: this is the sentence i would like to receive.
Maybe there are some more lines
string = “this is the sentence i would like to receive. Maybe there are some more lines”
Could somebody help me to receive the text in a string between “StartWord” and “Best regards”?
You can try this expression
have a look here:
the . will exclude the \n linebreak. That’s why we used the \s\S pattern in an ungreedy manner
thanks, that helped quit well!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.