Frege 中的正则表达式文字

Regex literal in Frege

用于在 Frege 中指定正则表达式文字的重音符号的 unicode 代码是什么?

该字符称为 Acute Accent,其 unicode 为 00B4。在 ubuntu 中,您可以使用 Ctrl+Shift+u 键入,然后键入00B4 然后 space。但是,如果您的正则表达式文字超过一个字符,您实际上不必使用它,在这种情况下,您可以只使用撇号。

引用 doc:

Regular expression literals have type Regex and are written:

 ´\b(foo|bar)\b´       -- string enclosed in grave accents
 '\w+'                 -- string with length > 1 enclosed in apostrophes
The notation with the apostrophes has been introduced because many have a hard time entering a grave accent mark on their terminal. However, it is not possible to write a regular expressions with length 1 this way, because then the literal gets interpreted as Char literal. (One can write something like '(?:X)' for a Regex that matches a single 'X').