Hello guys,
I have following string:
String str= "COO OPP (404) 851-1331 ext. 1520 "
I want to get result as (404) 851-1331 ext. 1520 like this by using regular expression only.
Can anyone provide me exact regular expression for the same.
Thanks,
skini76
October 26, 2018, 10:33am
2
Why can’t you use substring ?
@Mangesh_kulkarni Try below Regex
String strVariable = System.Text.RegularExpressions.Regex.Match(str,“(?<=COO OPP).+”).ToString
Divyashreem
(Divyashree Muddagangaiah)
October 28, 2018, 7:01am
4
“(\d{3})\s\d{3}-\d{4}*\d{4}”
palindrome
(Nitin Safaya)
October 28, 2018, 7:42am
5
Check this out: \(\d{3}\).*(ext.)\s\d{4}