替换字符串字符替换字符串字符替换字符串字符替换字符串字符
  • 文章
  • 正则表达式
    • 工具
  • 登录
找到的结果: {phrase} (显示: {results_count} 共: {results_count_total})
显示: {results_count} 共: {results_count_total}

加载更多搜索结果...

搜索范围
模糊匹配
搜索标题
搜索内容
发表 admin at 2024年3月5日
类别
  • 正则表达式
标签
替换字符串字符
  • 简
  • 繁
  • En
关于正则表达式 » 正则表达式参考 » 替换字符串参考 » 替换字符串字符

替换参考
简介
目录
字符
配对文本和反向引用
内容和大小写转换
条件式
正则表达式参考
本网站更多内容
简介
正则表达式快速开始
正则表达式教程
替换字符串教程
应用程序和语言
正则表达式范例
正则表达式参考
替换字符串参考

替换字符串字符

功能语法说明范例.NET Java Perl PCRE2 PHP Delphi R JavaScript VBScript XRegExp Python Ruby std::regex Boost Tcl ARE Oracle XPath
反斜线 反斜线后接任何无法形成代码的字符 反斜线后接任何无法与反斜线组合成替换字符串代码的字符,会插入实际的转译字符。 替换为 \! 会产生 ! 否是是延伸否否是否否否3.7–3.10 错误否sed是否否错误
反斜线 反斜线无法形成代码 反斜线不属于替换字符串代码的一部分,就是实际的反斜线。 替换为 \! 会产生 \! 是否否缺省是是否是是是是是缺省否是是错误
反斜线 尾端反斜线 替换字符串尾端的反斜线就是实际的反斜线。 以 \ 取代会产生 \ 是错误错误缺省是是否是是是错误是缺省是是是错误
反斜线 \\ 反斜线会转义自己。 以 \\ 取代会产生 \ 否是是延伸是是是否否否是是sed是是是是
美元符号 未形成令牌的美元符号 未形成替换字符串令牌的美元符号是字面上的美元符号。 以 $! 取代会产生 $! 是错误错误错误是是是是是错误是是是是是是错误
美元符号 尾随美元符号 替换字符串结尾的美元符号是字面上的美元符号。 以 $ 取代会产生 $ 是错误错误错误是是是是是2–4是是缺省 VC’15–VC’22
sed VC’08–VC’22
是是是错误
美元符号 $$ 美元符号会转义自己。 以 $$ 取代会产生 $ 是错误错误是否是否是是是否否缺省全部
缺省
否否错误
美元符号 \$ 反斜线会转义美元符号。 以 \$ 取代会产生 $ 否是是延伸是是是否否否3.7–3.10 错误否sed是否否是
十六进位转义 \xFF,其中 FF 是 2 个十六进位数字 插入在代码页中指定位置的字符 使用 Latin-1 代码页时,\xA9 会插入 © 否否是延伸字符串否字符串字符串否字符串字符串字符串字符串是字符串否错误
Unicode 转义 \uFFFF,其中 FFFF 是 4 个十六进位数字 插入特定的 Unicode 码点。 \u00E0 仅插入编码为 U+00E0 的 à。 \u00A9 插入 © 否字符串否延伸错误否否字符串字符串否字符串字符串1.9 字符串字符串否字符串否错误
Unicode 转义 \u{FFFF},其中 FFFF 是 1 到 4 个十六进位数字 插入特定的 Unicode 码点。 \u{E0} 仅插入编码为 U+00E0 的 à。 \u{A9} 插入 © 否否否延伸错误7.0.0 字符串否字符串字符串否字符串3.7–3.10 错误1.9 字符串否否否否错误
Unicode 转义 \x{FFFF},其中 FFFF 是 1 到 4 个十六进位数字 插入特定的 Unicode 码点。 \x{E0} 仅插入编码为 U+00E0 的 à。 \x{A9} 插入 © 否否是延伸否否否否否否3.7–3.10 错误否否是否否错误
字符转义 \n、\r 和 \t 分别插入换行字符、回车字符和一个 tab 字符 \r\n 插入 Windows CRLF 换行符号 否字符串是延伸字符串否字符串字符串否字符串是字符串字符串是字符串否错误
字符转义 \a 插入「警示」或「铃声」控制字符 (ASCII 0x07) 否否是延伸否否否否否否是否否是否否错误
字符转义 \b 插入「退格」控制字符(ASCII 0x08) 否否是延伸错误否否否否否否是否否否否否错误
字符转义 \e 插入「转义」控制字符(ASCII 0x1B) 否否是延伸否否否否否否3.7–3.10 错误否否是否否错误
字符转义 \f 插入「换页」控制字符(ASCII 0x0C) 否否是延伸否否否否否否是否否是否否错误
字符转义 \v 插入「垂直定位标签」控制字符(ASCII 0x0B) 否否否延伸错误否否否否否否是否否是否否错误
控制字符转义 \cA 到 \cZ 插入 ASCII 字符 Control+A 到 Control+Z,等同于 \x01 到 \x1A \cM\cJ 插入 Windows CRLF 换行符号 否否是延伸否否否否否否否否否是否否否
控制字符转义 \ca 到 \cz 插入 ASCII 字符 Control+A 到 Control+Z,等同于 \x01 到 \x1A \cm\cj 插入 Windows CRLF 换行符号 否否是延伸否否否否否否否否否是否否否
NULL 转义 \0 插入 NULL 字符 否否是延伸错误否否否否否否是否否全部
缺省
否否错误
八进位转义 \o{7777} 其中 7777 是任何八进位数字 插入在活动编码页中指定位置的字符 \o{20254} 在使用 Unicode 时插入 € 否否5.14延伸否否否否否否3.7–3.10 错误否否否否否错误
八进位转义 \10 到 \77 插入在 ASCII 表中指定位置的字符 \77 插入 ? 否否是延伸错误否否否否否否否否否否否否错误
八进位转义 \100 到 \177 插入在 ASCII 表中指定位置的字符 \100 插入 @ 否否是延伸错误否否否否否否是否否否否否错误
八进位转义 \200 到 \377 插入在活动编码页中指定位置的字符 \377 在使用 Latin-1 编码页时插入 ÿ 否否是延伸错误否否否否否否是否否否否否错误
八进位转义 \400 到 \777 插入在活动编码页中指定位置的字符 \777 在使用 Unicode 时插入 ǿ 否否是延伸错误否否否否否否否否否否否否错误
八进位转义 \01 到 \07 插入在 ASCII 表中指定位置的字符 \07 插入「铃声」字符 否否是延伸错误否否否否否否是否否全部
缺省
否否错误
八进位转义 \010 到 \077 插入在 ASCII 表中指定位置的字符 \077 插入 ? 否否是延伸错误否否否否否否是否否全部
缺省
否否错误
功能语法说明范例.NET Java Perl PCRE2 PHP Delphi R JavaScript VBScript XRegExp Python Ruby std::regex Boost Tcl ARE Oracle XPath
替換字串字元
  • 简
  • 繁
  • En
關於正規表示式 » 正規表示式參考 » 替換字串參考目錄 » 替換字串字元

替換參考
簡介
目錄
字元
配對文字和反向參照
內容和大小寫轉換
條件式
正規表示式參考
本網站更多內容
簡介
正規表示式快速開始
正規表示式教學
替換字串教學
應用程式和語言
正規表示式範例
正規表示式參考
替換字串參考

替換字串字元

功能語法說明範例.NET Java Perl PCRE2 PHP Delphi R JavaScript VBScript XRegExp Python Ruby std::regex Boost Tcl ARE Oracle XPath
反斜線 反斜線後接任何無法形成代碼的字元 反斜線後接任何無法與反斜線組合成替換字串代碼的字元,會插入實際的轉譯字元。 替換為 \! 會產生 ! 否是是延伸否否是否否否3.7–3.10 錯誤否sed是否否錯誤
反斜線 反斜線無法形成代碼 反斜線不屬於替換字串代碼的一部分,就是實際的反斜線。 替換為 \! 會產生 \! 是否否預設是是否是是是是是預設否是是錯誤
反斜線 尾端反斜線 替換字串尾端的反斜線就是實際的反斜線。 以 \ 取代會產生 \ 是錯誤錯誤預設是是否是是是錯誤是預設是是是錯誤
反斜線 \\ 反斜線會跳脫自己。 以 \\ 取代會產生 \ 否是是延伸是是是否否否是是sed是是是是
美元符號 未形成令牌的美元符號 未形成替換字串令牌的美元符號是字面上的美元符號。 以 $! 取代會產生 $! 是錯誤錯誤錯誤是是是是是錯誤是是是是是是錯誤
美元符號 尾隨美元符號 替換字串結尾的美元符號是字面上的美元符號。 以 $ 取代會產生 $ 是錯誤錯誤錯誤是是是是是2–4是是預設 VC’15–VC’22
sed VC’08–VC’22
是是是錯誤
美元符號 $$ 美元符號會跳脫自己。 以 $$ 取代會產生 $ 是錯誤錯誤是否是否是是是否否預設全部
預設
否否錯誤
美元符號 \$ 反斜線會跳脫美元符號。 以 \$ 取代會產生 $ 否是是延伸是是是否否否3.7–3.10 錯誤否sed是否否是
十六進位跳脫 \xFF,其中 FF 是 2 個十六進位數字 插入在程式碼頁中指定位置的字元 使用 Latin-1 程式碼頁時,\xA9 會插入 © 否否是延伸字串否字串字串否字串字串字串字串是字串否錯誤
Unicode 跳脫 \uFFFF,其中 FFFF 是 4 個十六進位數字 插入特定的 Unicode 碼點。 \u00E0 僅插入編碼為 U+00E0 的 à。 \u00A9 插入 © 否字串否延伸錯誤否否字串字串否字串字串1.9 字串字串否字串否錯誤
Unicode 跳脫 \u{FFFF},其中 FFFF 是 1 到 4 個十六進位數字 插入特定的 Unicode 碼點。 \u{E0} 僅插入編碼為 U+00E0 的 à。 \u{A9} 插入 © 否否否延伸錯誤7.0.0 字串否字串字串否字串3.7–3.10 錯誤1.9 字串否否否否錯誤
Unicode 跳脫 \x{FFFF},其中 FFFF 是 1 到 4 個十六進位數字 插入特定的 Unicode 碼點。 \x{E0} 僅插入編碼為 U+00E0 的 à。 \x{A9} 插入 © 否否是延伸否否否否否否3.7–3.10 錯誤否否是否否錯誤
字元跳脫 \n、\r 和 \t 分別插入換行字元、回車字元和一個 tab 字元 \r\n 插入 Windows CRLF 換行符號 否字串是延伸字串否字串字串否字串是字串字串是字串否錯誤
字元跳脫 \a 插入「警示」或「鈴聲」控制字元 (ASCII 0x07) 否否是延伸否否否否否否是否否是否否錯誤
字元跳脫 \b 插入「退格」控制字元(ASCII 0x08) 否否是延伸錯誤否否否否否否是否否否否否錯誤
字元跳脫 \e 插入「跳脫」控制字元(ASCII 0x1B) 否否是延伸否否否否否否3.7–3.10 錯誤否否是否否錯誤
字元跳脫 \f 插入「換頁」控制字元(ASCII 0x0C) 否否是延伸否否否否否否是否否是否否錯誤
字元跳脫 \v 插入「垂直定位標籤」控制字元(ASCII 0x0B) 否否否延伸錯誤否否否否否否是否否是否否錯誤
控制字元跳脫 \cA 到 \cZ 插入 ASCII 字元 Control+A 到 Control+Z,等同於 \x01 到 \x1A \cM\cJ 插入 Windows CRLF 換行符號 否否是延伸否否否否否否否否否是否否否
控制字元跳脫 \ca 到 \cz 插入 ASCII 字元 Control+A 到 Control+Z,等同於 \x01 到 \x1A \cm\cj 插入 Windows CRLF 換行符號 否否是延伸否否否否否否否否否是否否否
NULL 跳脫 \0 插入 NULL 字元 否否是延伸錯誤否否否否否否是否否全部
預設
否否錯誤
八進位跳脫 \o{7777} 其中 7777 是任何八進位數字 插入在活動編碼頁中指定位置的字元 \o{20254} 在使用 Unicode 時插入 € 否否5.14延伸否否否否否否3.7–3.10 錯誤否否否否否錯誤
八進位跳脫 \10 到 \77 插入在 ASCII 表中指定位置的字元 \77 插入 ? 否否是延伸錯誤否否否否否否否否否否否否錯誤
八進位跳脫 \100 到 \177 插入在 ASCII 表中指定位置的字元 \100 插入 @ 否否是延伸錯誤否否否否否否是否否否否否錯誤
八進位跳脫 \200 到 \377 插入在活動編碼頁中指定位置的字元 \377 在使用 Latin-1 編碼頁時插入 ÿ 否否是延伸錯誤否否否否否否是否否否否否錯誤
八進位跳脫 \400 到 \777 插入在活動編碼頁中指定位置的字元 \777 在使用 Unicode 時插入 ǿ 否否是延伸錯誤否否否否否否否否否否否否錯誤
八進位跳脫 \01 到 \07 插入在 ASCII 表中指定位置的字元 \07 插入「鈴聲」字元 否否是延伸錯誤否否否否否否是否否全部
預設
否否錯誤
八進位跳脫 \010 到 \077 插入在 ASCII 表中指定位置的字元 \077 插入 ? 否否是延伸錯誤否否否否否否是否否全部
預設
否否錯誤
功能語法說明範例.NET Java Perl PCRE2 PHP Delphi R JavaScript VBScript XRegExp Python Ruby std::regex Boost Tcl ARE Oracle XPath
Replacement String Characters
  • 简
  • 繁
  • En
About Regular Expressions » Regular Expressions Reference » Replacement Strings Reference » Replacement String Characters

Replacement Reference
Introduction
Table of Contents
Characters
Matched Text & Backreferences
Context & Case Conversion
Conditionals
Regular Expressions Reference
More on This Site
Introduction
Regular Expressions Quick Start
Regular Expressions Tutorial
Replacement Strings Tutorial
Applications and Languages
Regular Expressions Examples
Regular Expressions Reference
Replacement Strings Reference

Replacement String Characters

FeatureSyntaxDescriptionExample.NET Java Perl PCRE2 PHP Delphi R JavaScript VBScript XRegExp Python Ruby std::regex Boost Tcl ARE Oracle XPath
Backslash Backslash followed by any character that does not form a token A backslash that is followed by any character that does not form a replacement string token in combination with the backslash inserts the escaped character literally. Replacing with \! yields ! noYESYESextendednonoYESnonono3.7–3.10 errornosedYESnonoerror
Backslash A backslash that does not form a token A backslash that is not part of a replacement string token is a literal backslash. Replacing with \! yields \! YESnonodefaultYESYESnoYESYESYESYESYESdefaultnoYESYESerror
Backslash Trailing backslash A backslash at the end of the replacement string is a literal backslash. Replacing with \ yields \ YESerrorerrordefaultYESYESnoYESYESYESerrorYESdefaultYESYESYESerror
Backslash \\ A backslash escapes itself. Replacing with \\ yields \ noYESYESextendedYESYESYESnononoYESYESsedYESYESYESYES
Dollar A dollar that does not form a token A dollar sign that does not form a replacement string token is a literal dollar sign. Replacing with $! yields $! YESerrorerrorerrorYESYESYESYESYESerrorYESYESYESYESYESYESerror
Dollar Trailing dollar A dollar sign at the end of the replacement string is a literal dollar sign. Replacing with $ yields $ YESerrorerrorerrorYESYESYESYESYES2–4YESYESdefault VC’15–VC’22
sed VC’08–VC’22
YESYESYESerror
Dollar $$ A dollar sign escapes itself. Replacing with $$ yields $ YESerrorerrorYESnoYESnoYESYESYESnonodefaultall
default
nonoerror
Dollar \$ A backslash escapes a dollar sign. Replacing with \$ yields $ noYESYESextendedYESYESYESnonono3.7–3.10 errornosedYESnonoYES
Hexadecimal escape \xFF where FF are 2 hexadecimal digits Inserts the character at the specified position in the code page \xA9 inserts © when using the Latin-1 code page nonoYESextendedstringnostringstringnostringstringstringstringYESstringnoerror
Unicode escape \uFFFF where FFFF are 4 hexadecimal digits Inserts a specific Unicode code point. \u00E0 inserts à encoded as U+00E0 only. \u00A9 inserts © nostringnoextended errornonostringstringnostringstring1.9 stringstringnostringnoerror
Unicode escape \u{FFFF} where FFFF are 1 to 4 hexadecimal digits Inserts a specific Unicode code point. \u{E0} inserts à encoded as U+00E0 only. \u{A9} inserts © nononoextended error7.0.0 stringnostringstringnostring3.7–3.10 error1.9 stringnonononoerror
Unicode escape \x{FFFF} where FFFF are 1 to 4 hexadecimal digits Inserts a specific Unicode code point. \x{E0} inserts à encoded as U+00E0 only. \x{A9} inserts © nonoYESextendednononononono3.7–3.10 errornonoYESnonoerror
Character escape \n, \r and \t Insert an LF character, CR character and a tab character respectively \r\n inserts a Windows CRLF line break nostringYESextendedstringnostringstringnostringYESstringstringYESstringnoerror
Character escape \a Insert the “alert” or “bell” control character (ASCII 0x07) nonoYESextendednonononononoYESnonoYESnonoerror
Character escape \b Insert the “backspace” control character (ASCII 0x08) nonoYESextended errornonononononoYESnononononoerror
Character escape \e Insert the “escape” control character (ASCII 0x1B) nonoYESextendednononononono3.7–3.10 errornonoYESnonoerror
Character escape \f Insert the “form feed” control character (ASCII 0x0C) nonoYESextendednonononononoYESnonoYESnonoerror
Character escape \v Insert the “vertical tab” control character (ASCII 0x0B) nononoextended errornonononononoYESnonoYESnonoerror
Control character escape \cA through \cZ Insert an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A \cM\cJ inserts a Windows CRLF line break nonoYESextendednononononononononoYESnonono
Control character escape \ca through \cz Insert an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A \cm\cj inserts a Windows CRLF line break nonoYESextendednononononononononoYESnonono
NULL escape \0 Insert the NULL character nonoYESextended errornonononononoYESnonoall
default
nonoerror
Octal escape \o{7777} where 7777 is any octal number Inserts the character at the specified position in the active code page \o{20254} inserts € when using Unicode nono5.14extendednononononono3.7–3.10 errornononononoerror
Octal escape \10 through \77 Inserts the character at the specified position in the ASCII table \77 inserts ? nonoYESextended errornonononononononononononoerror
Octal escape \100 through \177 Inserts the character at the specified position in the ASCII table \100 inserts @ nonoYESextended errornonononononoYESnononononoerror
Octal escape \200 through \377 Inserts the character at the specified position in the active code page \377 inserts ÿ when using the Latin-1 code page nonoYESextended errornonononononoYESnononononoerror
Octal escape \400 through \777 Inserts the character at the specified position in the active code page \777 inserts ǿ when using Unicode nonoYESextended errornonononononononononononoerror
Octal escape \01 through \07 Inserts the character at the specified position in the ASCII table \07 inserts the “bell” character nonoYESextended errornonononononoYESnonoall
default
nonoerror
Octal escape \010 through \077 Inserts the character at the specified position in the ASCII table \077 inserts ? nonoYESextended errornonononononoYESnonoall
default
nonoerror
FeatureSyntaxDescriptionExample.NET Java Perl PCRE2 PHP Delphi R JavaScript VBScript XRegExp Python Ruby std::regex Boost Tcl ARE Oracle XPath
©2015-2025 艾丽卡 support@alaica.com