Regex - convert string to number?

Hi,
I'm trying to convert the date that comes from a string to a number.

Sitemap:
{ "_id":"youtube-history-videos", "startUrl":[ "https://www.youtube.com/feed/history" ], "selectors":[ { "id":"parent-elem", "type":"SelectorElement", "parentSelectors":[ "_root" ], "selector":"div#contents.ytd-section-list-renderer", "multiple":true, "delay":0 }, { "id":"date", "type":"SelectorElementScroll", "parentSelectors":[ "parent-elem" ], "selector":"ytd-item-section-renderer", "multiple":true, "delay":2000 }, **{** ** "id":"when",** ** "type":"SelectorText",** ** "parentSelectors":[** ** "date"** ** ],** ** "selector":"div#title",** ** "multiple":true,** ** "regex":"",** ** "delay":0** ** },** { "id":"author", "type":"SelectorText", "parentSelectors":[ "date" ], "selector":".complex-string a", "multiple":true, "regex":"", "delay":0 }, { "id":"title", "type":"SelectorText", "parentSelectors":[ "date" ], "selector":".yt-simple-endpoint yt-formatted-string", "multiple":true, "regex":"", "delay":0 }, { "id":"views", "type":"SelectorText", "parentSelectors":[ "date" ], "selector":"span.ytd-video-meta-block", "multiple":true, "regex":"", "delay":0 } ] }

Basically the date comes in Today, Yesterday, Friday, and then when it is before that, it would be something like Aug 18th etc, and sometimes even "2 days ago/7 days ago". My aim is to have something like dd-mm-yyyy

Currently this is not possible with WS's regex because it only does matching and not replacements.

But this should be a fairly simple problem to solve by post-processing with a program or script. You may need to take into account when you do the post-processing though. E.g. if you do your scraping late at night but only post-process the results the next morning, then the dates for "Today" and "Yesterday" would be different.