I have multiple emails as text files and I have to extract the email's subject using regex
Subject: Meet the new Customer Support Representative
Dear team,
I am pleased to introduce you to [Name] who is starting today as a Customer Support Representative. She will be providing technical support and assistance to our users, ensuring they enjoy the best experience with our products.
Feel free to greet [Name] in person and congratulate her on the new role!
Best regards, [Your name] [Job title]
To extract the subject line from this sample email text, I tried using this regex: r"(?m)^Subject: (.+)$"
The output I got is:
Meet the new Customer Support Representative
But the output that I require is:
Subject: Meet the new Customer Support Representative
How can I modify this regex to get the "Subject:" part too?