Corner quotes in Unicode
In his book Mastering Regular Expressions, Jeffrey Friedl uses corner quotes to delimit regular expressions. Here's an example I found by opening his book a random:
(\.\d\d[1-9]?)\d*
The upper-left corner at the beginning and the lower-right corner at the end are not part of the regular expression. This particularly comes in handy if a regular expression begins or ends with white space.
(It wouldn't do to, say, use quotation marks because this would invite confusion between the regular expression itself and a quoted string used to express that regular expression in a programming language.)
I've thought about using Friedl's convention but I didn't think it could be done with plain text. It can, using Unicode character U+231C at the beginning and U+231D at the end.
There are four corner quotes:
|------+--------+---------------------| | Char | Code | Name | |------+--------+---------------------| | | U+231C | TOP LEFT CORNER | | | U+231D | TOP RIGHT CORNER | | | U+231E | BOTTOM LEFT CORNER | | | U+231F | BOTTOM RIGHT CORNER | |------+--------+---------------------|
Corner quotes are also used in logic to denote Godel numbers, e.g. denotes the Godel number for .
Corner quotes are also known as Quine quotes. They usually come in the pair top left and top right, rather than top left and bottom right as in Friedl's usage.
Update: As Rob Wells points out in the comments, it seems Friedl used CJK quote marks (U+300C) and (U+300D) rather than the corner quotes, which makes sense given that Friedl speaks Japanese.
Related postsThe post Corner quotes in Unicode first appeared on John D. Cook.