
Is it possible to use regex to convert dates in Roam's format, i.e. March 13th, 2023, to standard yyyy-mm-dd (2023-03-13) format? I know enough regex to extract the digits for the day and year, but how would convert a text match ("March", "April") into digits? Or do you have to do 12 search/replace operations first to convert the months, and then use regex to reorganise the resulting strings?
--
You received this message because you are subscribed to the Google Groups "TextSoap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to textsoap+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/textsoap/1636bcc2-abb2-4382-a372-0a0410fc5664n%40googlegroups.com.


The If action will match [[March 13, 2023]], but not "March 13th, 2023"m but will match [[Junk 20, 2023]] and then try to apply the Normalize Date cleaner to each match.
Two additions. At the beginning:
\[{2} - [ needs to be escaped in regex, so we look use \[ and {2} to explicitly say 2 (we could write \[\[ as well, but that's a lot of slashes)
And at the end:
\]{2} - ] doesn't need to be escaped, but I do it for convention (and to keep syntax highlighting happy). Again {2} is explicit count, and could be written as \]\] or even ]] if you don't mind the goofed syntax highlight.
To view this discussion on the web visit https://groups.google.com/d/msgid/textsoap/f2c165e5-7214-4eb3-b6b1-535e449e02ffn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/textsoap/cfc7bb45-9cc3-461f-ac97-6efe606d0cc6n%40googlegroups.com.