-1

I want to fetch 01-01-2019 from Ram~01-01-2019 using regex. Can someone help?

I have a table in sql where two columns are present id and data. In data column, Ram~01-01-2019 -- this kind of data is getting stored from which I want to fetch dates only.

2 Answers2

2

Maybe,

(?<=~)\d{1,2}-\d{1,2}-\d{4}

might be close.

Demo 1

or without lookarounds,

[^~\r\n]*~(\d{1,2}-\d{1,2}-\d{4})

Demo 2

Emma
  • 27,428
  • 11
  • 44
  • 69
0

Use this regex to extract date only which have this kind of format dd-dd-dddd

\d{2}\-\d{2}\-\d{4}
Aziz.G
  • 3,599
  • 2
  • 17
  • 35