Regex to replace the string with empty value

I have an API response which contains date in below format.
“PERIODID4_TSTAMP”: “/Date(1632614400000)/”
I want to replace /Date(1632614400000)/ with 1632614400000. Number of digit is always 13.

I tried below code but i get the output with slash, for ex getting output as: /1632614400000/

How to remove extra slash using below regex.
System.Text.RegularExpressions.Regex.Replace(str_DataResponse,“Date((\d{13}))”,“$1”)

Thanks

Hello @Raj578 , Try this Regex
\/Date\((\d{13})\)\/

System.Text.RegularExpressions.Regex.Replace(YourStr,"\/Date\((\d{13})\)\/","$1")

image

“/Date(1632614400000)/”.Split({“(”,“)”},StringSplitOptions.None)(1)

image

cheers

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=\D)\d{13}(?=\D)").Value

Sequence1.xaml (5.4 KB)

Regards,

Hi @Raj578

You can use the below regular expression

- Assign -> StrInput = "PERIODID4_TSTAMP”: “/Date(1632614400000)/"
- Assign -> Output = System.Text.RegularExpressions.Regex.Match(StrInput.ToString,“((?<=\()\d{13}(?=\)))”).value

image

Hope it helps!!