DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

MANOHARA  M
MANOHARA M

Posted on

Need to extract text between two words that last occurred

I am using (?s)(?<=Observation Description:\s).*?(?=Attachment) to get the text between β€œObservation Description:” and β€œAttachment” words.

I am able to do it with above expression. The word β€˜Observation Description’ appears at many places. I want to extract the text between last occurrence of β€œObservation Description” and next first β€œAttachment”.

Can you help me how can I do it ?

Top comments (0)

πŸ—£ Want to join the conversation?

Β 
It's easy! Become a DEV member to follow this post, comment, and more.