Hi all,
I have a string variable that has the following content: “Exmo.(a) Senhor(a)\r\nA23456789\r\nRua”. I want everything that is between “Senhor(a)” and “\r\nRua”. Any ideas?
Thank you,
Cátia
Hi all,
I have a string variable that has the following content: “Exmo.(a) Senhor(a)\r\nA23456789\r\nRua”. I want everything that is between “Senhor(a)” and “\r\nRua”. Any ideas?
Thank you,
Cátia
Refer this regex
If MyText
is equal to “Exmo.(a) Senhor(a)\r\nA23456789\r\nRua”
, set another variable to System.Text.RegularExpressions.Regex.Match(MyText, "(?<=Senhor\(a\)).*(?=\r\nRua)").Value
.
It isn’t displaying anything…
Hi,
Can you try the following expression?
System.Text.RegularExpressions.Regex.Match(text,"(?<=Senhor\(a\))[\s\S]*?(?=\r\nRua)").Value
Regards,
Thanks! This solves it
Now 2 more points that I want to had:
Any sugestion?
Hi,
How about the following?
System.Text.RegularExpressions.Regex.Match(text,"(?<=Senhor\(a\)\r)[\s\S]*?(?=\r)").Value
Regards,
Thank you so much!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.