Hello,
I am trying to use regex to extract specific text after -.the text is;
[EXTERNAL]Ahadi Term Assurance –Full Name I need to only extract the word ‘Full Name’
kindly assist
Hello,
I am trying to use regex to extract specific text after -.the text is;
[EXTERNAL]Ahadi Term Assurance –Full Name I need to only extract the word ‘Full Name’
kindly assist
If it’s always going to be after the - then use Split.
myVar = “[EXTERNAL]Ahadi Term Assurance –Full Name”
myText = myVar.Split("-"c)(1)
Split gives you an array, so the first element (index 0) will be the text before the - and the second element (index 1) will be the text after.
You can also try with Split expression
Split("[EXTERNAL]Ahadi Term Assurance –Full Name","–")(1)
Regex Expression
System.Text.regularExpressions.Regex.Match(YourString,"(?<=\–)(\S.+)").Tostring
Regards
Gokul
Thank you so much. This works
Thank you, this expression works too
Try using Substring & Index
theText.Substring(theText.LastIndexOf("–") + 1)
This will just return the Details after the Dash - so you may want to add a Trim too
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.