-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
  • 26,487
  • 10
  • 35
  • 65
0

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

\d{2}\-\d{2}\-\d{4}
G.aziz
  • 3,365
  • 1
  • 13
  • 30