# 反斜杠

反斜杠（\）是一个倾斜方向与斜杠（/）相反的字符，在 Unicode 和 ASCII 中的编码为 U+005C，正式名称为**反向固线**（REVERSE SOLIDUS）。它是排版与计算机领域的字符，而非英语散文中的标准标点符号，主要用作 Windows 系统中的路径分隔符、字符串字面量中的转义字符、TeX 宏的前缀，以及集合差等数学运算符的替身。<sup>[1](https://www.unicode.org/reports/tr25/tr25-16d2.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 码位 | U+005C，名称反向固线，俗称反斜杠；1993 年随 Unicode 1.1 版加入<sup>[1](https://www.unicode.org/reports/tr25/tr25-16d2.html)</sup><sup> • </sup><sup>[2](https://codepoints.net/U%2B005C?lang=en)</sup> |
| 与斜杠的区别 | 固线 U+002F 用于分隔 URL 字段和标记可选项；反斜杠在普通英文文本中不是标点符号<sup>[1](https://www.unicode.org/reports/tr25/tr25-16d2.html)</sup><sup> • </sup><sup>[3](https://www.gsa.gov/reference/gsa-web-style-guide/written-style)</sup> |
| Windows 路径 | 反斜杠在 Windows 中分隔路径组件，如 "C:\path\file"，且因属保留字符而不能出现在文件或目录名中<sup>[4](https://learn.microsoft.com/windows/desktop/FileIO/naming-a-file)</sup> |
| 网络 | 通用命名约定（UNC）名称以两个反斜杠开头，如 \\server\share\path\file<sup>[4](https://learn.microsoft.com/windows/desktop/FileIO/naming-a-file)</sup> |
| 转义 | 在 C 系字符串字面量中，\\ 表示反斜杠本身；在 Rust 中，换行前未转义的 U+005C 会抑制字符串中的换行<sup>[5](https://previewnorm.com/iec/ISO%20IEC%2023270-2018%20PDF.pdf)</sup><sup> • </sup><sup>[6](https://doc.rust-lang.org/stable/reference/tokens.html?highlight=string+literal)</sup> |
| 数学 | U+005C 可替代 U+2216 SET MINUS 等运算符；专用的 REVERSE SOLIDUS OPERATOR 为 U+29F5<sup>[1](https://www.unicode.org/reports/tr25/tr25-16d2.html)</sup><sup> • </sup><sup>[7](https://www.unicode.org/L2/L2015/15215-tr25-14.pdf)</sup> |
| 历史 | 约 1937 至 1945 年间，Teletype Wheatstone 穿孔机的键盘上已出现反斜杠；1958 年之前没有任何计算机存在该字符，1961 年之前也极少用于文本<sup>[8](https://www.histo.cat/sabies/bob-bemer)</sup> |

## 名称与字符地位

Unicode 和 ASCII 的正式名称为反向固线（REVERSE SOLIDUS），反斜杠是公认的非正式名称。<sup>[1](https://www.unicode.org/reports/tr25/tr25-16d2.html)</sup> 该字符是固线 U+002F 的镜像，后者又称斜杠、斜线号或正斜杠。<sup>[1](https://www.unicode.org/reports/tr25/tr25-16d2.html)</sup> 在正式写作规范中，反斜杠与斜杠被区别对待：《澳大利亚风格手册》和 GSA 风格指南均指出，斜杠或正斜杠与反斜杠是两种不同的符号，反斜杠不具备斜杠在缩写、日期、比率或可选项中的功能。<sup>[3](https://www.gsa.gov/reference/gsa-web-style-guide/written-style)</sup><sup> • </sup><sup>[9](https://www.stylemanual.gov.au/grammar-punctuation-and-conventions/punctuation/forward-slashes)</sup> 美国政府印刷局风格手册同样区分正斜杠与反斜杠。<sup>[10](https://www.govinfo.gov/content/pkg/GOVPUB-D301-PURL-LPS113436/pdf/GOVPUB-D301-PURL-LPS113436.pdf)</sup>

## 历史

这个字符比键盘上大多数按键都年轻。据[埃里克·费舍尔](https://www.edgepedia.org/zh/eric-fischer)（Eric Fischer）提交给《计算史年鉴》（*Annals of the History of Computing*）的研究，约 1937 至 1945 年间，Teletype Wheatstone 穿孔机的键盘上已出现反斜杠。<sup>[8](https://www.histo.cat/sabies/bob-bemer)</sup> 同一记载指出，1958 年之前没有任何计算机存在该字符，1961 年之前它也极少用于文本。<sup>[8](https://www.histo.cat/sabies/bob-bemer)</sup>

**鲍勃·贝默与 ASCII。** 鲍勃·贝默（Bob Bemer）是一位通过委员会参与 ASCII 制定与标准化的程序员，在负责 ESC 和反斜杠等字符的委员会中任职。<sup>[11](https://www.itechguides.com/who-invented-the-backslash-and-who-helped-invent-ascii-bob-bemer-explained/)</sup> 由于该字符更早即已出现，不应无条件地将贝默列为第一个画出或使用反斜杠的人，但他在委员会的工作确立了该字符在标准中的地位，与后来对控制序列至关重要的转义字符并列。<sup>[11](https://www.itechguides.com/who-invented-the-backslash-and-who-helped-invent-ascii-bob-bemer-explained/)</sup>

## 路径分隔符

Windows 及其文件 API 使用反斜杠作为文件路径中的组件分隔符。微软的文件命名文档指出，反斜杠将文件名与其路径分开，也将一个目录名与另一个目录名分开，且它是保留字符，不能用于文件或目录本身的名称。<sup>[4](https://learn.microsoft.com/windows/desktop/FileIO/naming-a-file)</sup> 同样的规则要求卷标识符中使用反斜杠，如 "C:\path\file" 中的 "C:\"，以及以 \\server\share 开头的 UNC 网络名称。<sup>[4](https://learn.microsoft.com/windows/desktop/FileIO/naming-a-file)</sup> 指向驱动器当前目录的相对路径可以只写盘符，冒号后不加反斜杠。<sup>[4](https://learn.microsoft.com/windows/desktop/FileIO/naming-a-file)</sup>

实际结果是面向用户的惯例长期存在分歧：微软自己的风格指南要求作者区分用于 URL 的斜杠与用于服务器和文件夹的反斜杠，并先写出术语再给出符号，如“输入两个反斜杠（\\）”。<sup>[12](https://learn.microsoft.com/en-us/style-guide/punctuation/slashes)</sup> Cengage 风格指南则将文件路径中的反斜杠使用限定于 Windows 系统。<sup>[13](https://styleguide.cengage.com/backslash.html)</sup>

## 转义与字符串字面量

在许多编程语言中，反斜杠引入转义序列，改变其后字符的含义。在 ISO/IEC 23270 转义表中，序列 \\ 表示反斜杠本身（U+005C），\' 表示单引号，\n 表示换行，\0 表示空字符，等等。<sup>[5](https://previewnorm.com/iec/ISO%20IEC%2023270-2018%20PDF.pdf)</sup> 由于反斜杠本身特殊，要表示其自身的 ASCII 编码 0x5C 就必须转义。<sup>[6](https://doc.rust-lang.org/stable/reference/tokens.html?highlight=string+literal)</sup> Rust 还将反斜杠用于续行：当字符串词元中换行前紧邻一个未转义的 U+005C 时，该换行不会出现在该词元所表示的字符串中。<sup>[6](https://doc.rust-lang.org/stable/reference/tokens.html?highlight=string+literal)</sup> 其他规范中也有类似约定，行末的反斜杠表示字符串在下一行继续。<sup>[14](https://cdn3.f-cdn.com/files/download/214164378/Foreword.pdf)</sup> reStructuredText 等标记系统同样使用反斜杠作为转义字符，以恢复标记字符的标准含义。<sup>[15](https://infosys.beckhoff.com/content/1033/tc3_plc_intro/4527573643.html)</sup> 消息头的协议规范要求头中出现的任何反斜杠（U+005C）都必须用特殊转义序列编码。<sup>[16](https://ftp.u-strasbg.fr/rfc/rfc3862.txt.pdf)</sup>

## 数学与 Unicode 变体

Unicode 将纯文本反斜杠与其所能替代的数学运算符区分开来。关于 Unicode 数学支持的技术报告称 U+005C 为“最著名的反向固线”，并列出其用途：文件路径名、TeX 宏名，以及替代 U+2216 SET MINUS 等运算符；正式的除法运算符是 U+2215 DIVISION SLASH，而非键盘字符。<sup>[1](https://www.unicode.org/reports/tr25/tr25-16d2.html)</sup> 标准中固线与反向固线的表格还包括用于组合任意分数的 U+2044 FRACTION SLASH、U+2215 DIVISION SLASH、U+2216 SET MINUS、U+29F5 REVERSE SOLIDUS OPERATOR、组合覆盖符 U+0337、U+0338 和 U+20E5、APL 函数符号 U+2340 BACKSLASH BAR 和 U+2342 QUAD BACKSLASH、小型与全角变体（U+FE68、U+FF0F、U+FF3C），以及空集符号 U+29B0 至 U+29B4。<sup>[7](https://www.unicode.org/L2/L2015/15215-tr25-14.pdf)</sup>

核心规范解释了纯文本形式与运算符形式分开编码的原因：数学运算符渲染在数学中心线上而非文本基线上，且斜杠对应的运算符在角度或长度上可能与标点符号不同，因此 Unicode 16.0 将 005C REVERSE SOLIDUS（反斜杠）与 2216 SET MINUS 并列，作为支持特定数学语义的有意去统一化。<sup>[17](https://www.unicode.org/versions/Unicode16.0.0/UnicodeStandard-16.0.pdf)</sup>

## 使用指南

由于读者经常混淆两种斜杠，风格指南建议明确措辞。微软的指南要求作者先写出术语，再在括号中给出符号，并在需要区分时说明斜杠用于 URL、反斜杠用于服务器和文件夹。<sup>[12](https://learn.microsoft.com/en-us/style-guide/punctuation/slashes)</sup>

## References

1. [UTR #25: Unicode Support for Mathematics, Unicode Consortium](https://www.unicode.org/reports/tr25/tr25-16d2.html)
2. [U+005C REVERSE SOLIDUS, Codepoints](https://codepoints.net/U%2B005C?lang=en)
3. [Written style, U.S. General Services Administration](https://www.gsa.gov/reference/gsa-web-style-guide/written-style)
4. [Naming Files, Paths, and Namespaces, Microsoft Learn](https://learn.microsoft.com/windows/desktop/FileIO/naming-a-file)
5. [ISO/IEC 23270:2018, escape sequence table (preview)](https://previewnorm.com/iec/ISO%20IEC%2023270-2018%20PDF.pdf)
6. [Tokens, The Rust Reference](https://doc.rust-lang.org/stable/reference/tokens.html?highlight=string+literal)
7. [Unicode Support for Mathematics (TR 25, revision 14), Unicode Consortium](https://www.unicode.org/L2/L2015/15215-tr25-14.pdf)
8. [Bob Bemer, Computer History Vignettes](https://www.histo.cat/sabies/bob-bemer)
9. [Forward slashes, Australian Government Style Manual](https://www.stylemanual.gov.au/grammar-punctuation-and-conventions/punctuation/forward-slashes)
10. [Chapter 22, Punctuation, U.S. Government Printing Office Style Manual](https://www.govinfo.gov/content/pkg/GOVPUB-D301-PURL-LPS113436/pdf/GOVPUB-D301-PURL-LPS113436.pdf)
11. [Bob Bemer, the Backslash and ASCII: Who Invented What?, iTechGuides](https://www.itechguides.com/who-invented-the-backslash-and-who-helped-invent-ascii-bob-bemer-explained/)
12. [Slashes, Microsoft Style Guide](https://learn.microsoft.com/en-us/style-guide/punctuation/slashes)
13. [Backslash (\), Cengage Style Guide](https://styleguide.cengage.com/backslash.html)
14. [Foreword (string literal continuation convention)](https://cdn3.f-cdn.com/files/download/214164378/Foreword.pdf)
15. [Escaping mechanism, Beckhoff Information System](https://infosys.beckhoff.com/content/1033/tc3_plc_intro/4527573643.html)
16. [RFC 3862, Common Presence and Instant Messaging](https://ftp.u-strasbg.fr/rfc/rfc3862.txt.pdf)
17. [The Unicode Standard, Version 16.0, Core Specification](https://www.unicode.org/versions/Unicode16.0.0/UnicodeStandard-16.0.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 25, 2026 · Edited: Sep 30, 2026; Oct 25, 2026 · Last review: Oct 25, 2026*

Topic: 社会与历史 › 语言与语言学 › 文字与符号系统 › Punctuation and orthographic marks

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/backslash

English original: https://www.edgepedia.org/backslash
