I have a broad set of text like so:
- "Hello there. Are you interested in a holiday in New York, then contact nyc@mydomain.com. Let us help you."
- "Hey mr! Are you interested in a holiday in LA, then contact la@mydomain.com. We got you!"
- "Welcome to our humbo home. Are you interested in a holiday in France, then contact france@mydomain.com. See you soon!"
I want to remove the string " Are you interested in a holiday in <place>, then contact <email>."
Here I don't know how many characters <place> has or what exactly the value of <email> is.
The result would be:
- "Hello there. Let us help you."
- "Hey mr! We got you!"
- "Welcome to our humbo home. See you soon!"
I've been trying out and googling for regex replacements with placeholders, but I only find INSERTING values with regex and string.format
examples, but nothing on replacing values.
I looked here, but in this sample there are already placeholders in the source text.
I also checked here and tested to replace at least the <place>:
txt = Regex.Replace(txt, " Are you interested in a holiday in \d+\.?\d*%;, then", "")
txt = Regex.Replace(txt, " Are you interested in a holiday in \\d+\\.?\\d*%;, then", "")
But nothing gets replaced.
How can I replace the source string that has dynamic and values?