System.Text.RegularExpressions.Regex.Matches(str,"(?<=Additional Information Requested.*\n).*")(System.Text.RegularExpressions.Regex.Matches(str,"(?<=Additional Information Requested.*\n).*").Count -1).Value
System.Text.RegularExpressions.Regex.Matches(yourString,"\S.*\n(?=Delivery - Work in Progress)")(System.Text.RegularExpressions.Regex.Matches(yourString,"\S.*\n(?=Delivery - Work in Progress)").Count-1)
Solution is working as expected but it throws error if no “Additional Information Requested” tag is present in string. It should return empty without any error.
Thanks for your response, however we want to extract the Open tag details which comes only after Additional Information requested. If we do not see any tag as Additional Information requested it should not return Open Tag details also
First check if the additional information is present in the string using contains… if you want to check the count then use str.split({“additional info…”},StringSplitOptions.None).count > 2 then it means you have two of them then use the match…that should solve the issue
Use >1 if you want to extract even if it is present only once
You can Split the entire string using “Additional Information requested” as below.
first get the input string to variable “strInput”. Then use the below expression to split the string with “Additional Information requested”
strInput.Split(“Additional Information requested”)
The to get the last content use the below expression and get result to a string variable
strList(strList.Count-1)
Then Pass the above output variable to the Matches activity as explained earlier.