Hi team,
need regex below two string values
String one str=“AMICA UNIONVILLE 13005”
Required Output =“AMICA UNIONVILLE”
String two str2=“AMICA UNIONVILLE (13005)”
Required Output =“AMICA UNIONVILLE”
note- these values are dynamic
please anyone help these regex
Regards,
Saikrishna
Parvathy
(PS Parvathy)
2
Hi @Mada_Sai_Krishna
Check the below regex:
[A-Z].*(?=\s+\d+|\s+\()
Regards
in assign use in this way
System.Text.RegularExpressions.Regex.Replace( yourtext, "(\s\d+)|\s(\(\d+\))", "")
Parvathy
(PS Parvathy)
5
Hi @Mada_Sai_Krishna
Check the below syntax for better understanding:
System.Text.RegularExpressions.Regex.Match(str, "[A-Z].*(?=\s+\d+|\s+\()").Value.Trim()

Regards
system
(system)
Closed
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.