Hi ,
need regex for below these string
String = [3:32 PM] Pothanakar Prabhakar
“status code=200\rResponse <?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">\r\n soap:Body \r\n <m:NumberToWordsResponse xmlns:m="http://www.dataaccess.com/webservicesserver/">\r\n <m:NumberToWordsResult>five hundred </m:NumberToWordsResult>\r\n </m:NumberToWordsResponse>\r\n </soap:Body>\r\n</soap:Envelope>”
in these need five hundread value it is changed dynamically
Kindly help me on that and dont post screen shot .
please send regex on the chat
lrtetala
(Lakshman Reddy)
August 25, 2023, 10:09am
2
Hi @Mada_Sai_Krishna
(?<=<m:NumberToWordsResult>).*(?=</m:NumberToWordsResult>)
I hope it helps!!
ppr
(Peter Preuss)
August 25, 2023, 10:11am
3
Your initial case description is not clear due the code snippet is incomplete.
It looks like you are dealing with XML which is defining namespaces. In such a case we would suggest to handle it properly with XML relatied options and not with Regex
XML Extraction - Handling Namespaces (Tableau, Soap, OASIS types) - Help / Community - UiPath Community Forum
mkankatala
(Mahesh Kankatala)
August 25, 2023, 10:13am
4
Hi @Mada_Sai_Krishna
You can use the below regular expression to extract the required output data.
System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“((?<=\>\s*)[\w\s]+(?=\s*\<))”)
lrtetala
(Lakshman Reddy)
August 25, 2023, 10:18am
6
@Mada_Sai_Krishna
If you got the solution for your question. Please mark it as solution to close the thread.
Regards,
Anil_G
(Anil Gorthi)
August 27, 2023, 6:34am
7
@Mada_Sai_Krishna
It looks like xml and it is not advised to use regex instead we need to use xml parsing and get the data …that way we can get clean data as well
cheers