You will need to be a lot more specific with your rules: it's very feasible to "pull" an address (or any other element) out of text but you need to be specific about what prefix and suffix delimits it.
With only the example above, you could say 'before the address will be the words "address is " and it will end with " here"' - and then it's relatively simple to build a Regular Expression that extracts "xyz" (or whatever that is in the "real world"):
(?<=address is ).*?(?= here)
Then it's easy to get the address with C# code using that Regex:
using System.Text.RegularExpressions;
...
public static Regex regex = new Regex("(?<=address is ).*?(?= here)", RegexOptions.CultureInvariant | RegexOptions.Compiled);
private void MyButton_Click(object sender, EventArgs e)
{
string inputText = "For example if I have address is xyz here the word address is static word but xyz will be dynamically changing in all files could anyone help how to code this?";
Match m = regex.Match(inputText);
if (m.Success)
{
string address = m.Value;
}
}
But ... you would need to look closely at real, live, data and decide what prefix and suffixes you actually need.
This may help:
Expresso[
^] - it's free, and it examines, tests, and generates Regular expressions.