Recent Changes

Updates since 1970-01-01 00:00 UTC

(for 2022-11-14_Doubling_backslashes only)

1 | 3 | 7 | 30 | 90 days
List latest change per page only List only major changes
List later changes RSS RSS with pages RSS with pages and diff

2022-11-14

  • 20:43 UTC (new) 2022-11-14 Doubling backslashes . . . . mbork Today’s post is not meant to be very useful to most people, but it serves as a demonstration of a point (well, that, and a bit of advertisement;-)). However strange it may sound, a few days ago I have a very atypical need. I needed to move some LaTeX code to a JSON file. This meant that all the backslashes had to be doubled, of course – LaTeX code is full of them, and they need to be escaped in JSON. Obviously, query-replace​’ing backslashes with double backslashes is easy, and query-replace only operates on the region when it is active, but I wanted to make sure I didn’t replace them twice by accidentally marking too much. So – partly as an exercise, I guess – I decided to write a command to replace every backslash in the region by two backslashes, but only if it was a single one.

More...

Filters