Change YYYY-MM-DD to YYYYMMDD everywhere in file
- by richardh
I can't just delete all of the hyphens, because elsewhere they are used as minus signs. I can find these dates with [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} but I can't figure out how to keep those three different digit wildcards in memory. My attempts end up replacing the dates with the search string (e.g., :%s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/[0-9]\{4\}[0-9]\{2\}[0-9]\{2\}/g).
Any ideas? If there's a command line solution, I'd love to learn that, too. Thanks!