Rmd<\/code>\u00a0and turns out it’s equally easy in Word.<\/p>\nJust use ([0-9]{1})(\\.)([0-9]{1})<\/code> as your search query and \\1\u00b7\\3<\/code> as your replacement with the “Use wildcards” option.<\/p>\nWe (as a field) should still be moving over to doing our drafting in Rmd<\/code>\u00a0or LaTeX though. The bloat on MS Word makes working with moderate sized manuscripts with figures painful.<\/p>\nIf that code is gibberish to you, I highly recommend learning some basic regex<\/code>. It will likely end up being one of those tools you rarely use and you’ll need to use Google or StackOverflow to assist you, but it can make complex string extraction much easier.<\/p>\n[0-9]<\/code>\u00a0just means I want any character between 0 and 9. {1}<\/code>\u00a0means I want exactly one of the thing to the left. \\.<\/code>\u00a0means I want a literal period. So the whole phrase means, “I want to find text where there is exactly one number to the left of a period and one number to the right of a period.”<\/p>\nThe parenthesis just groups the query so I can refer to them later. Thus, the replacement is just saying, “Take the first group (\\1<\/code>), add an interpunct (\u00b7<\/code>), then add the third group (\\3<\/code>).”<\/p>\nMagic.<\/p>\n
Update 1\/17\/21.<\/strong><\/p>\nSeveral people have asked how to undo this \u2014 just copy an interpuct in your document and use regular find-and-replace to replace it with a period. The interpunct should be rare enough you don’t need regex to undo it. Hope that helps!<\/p>\n","protected":false},"excerpt":{"rendered":"
t turns out Microsoft Word’s “Advanced Find and Replace” is quite… well, advanced. You can actually use regex\u00a0to do relatively complex find and replace functions. For example, The Lancet requires that all decimal points be middle dots (i.e., interpuncts). This is pretty trivial in LaTeX or Rmd\u00a0and turns out it’s equally easy in Word. Just use ([0-9]{1})(\\.)([0-9]{1}) as your search query and \\1\u00b7\\3 as your replacement with the “Use wildcards” option. We (as a field) should still be moving over to doing our drafting in Rmd\u00a0or LaTeX though. The bloat on MS Word makes working with moderate sized manuscripts with …<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"_links":{"self":[{"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/posts\/1597"}],"collection":[{"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/comments?post=1597"}],"version-history":[{"count":1,"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/posts\/1597\/revisions"}],"predecessor-version":[{"id":2248,"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/posts\/1597\/revisions\/2248"}],"wp:attachment":[{"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/media?parent=1597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/categories?post=1597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mathewkiangcom.local\/wp-json\/wp\/v2\/tags?post=1597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}