1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Sed Format String Syntax</title> 5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../index.html" title="Boost.Regex 5.1.4"> 8<link rel="up" href="../format.html" title="Search and Replace Format String Syntax"> 9<link rel="prev" href="../format.html" title="Search and Replace Format String Syntax"> 10<link rel="next" href="perl_format.html" title="Perl Format String Syntax"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="../format.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../format.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="perl_format.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h3 class="title"> 27<a name="boost_regex.format.sed_format"></a><a class="link" href="sed_format.html" title="Sed Format String Syntax">Sed Format String Syntax</a> 28</h3></div></div></div> 29<p> 30 Sed-style format strings treat all characters as literals except: 31 </p> 32<div class="informaltable"><table class="table"> 33<colgroup> 34<col> 35<col> 36</colgroup> 37<thead><tr> 38<th> 39 <p> 40 character 41 </p> 42 </th> 43<th> 44 <p> 45 description 46 </p> 47 </th> 48</tr></thead> 49<tbody> 50<tr> 51<td> 52 <p> 53 & 54 </p> 55 </td> 56<td> 57 <p> 58 The ampersand character is replaced in the output stream by the 59 whole of what matched the regular expression. Use \& to output 60 a literal '&' character. 61 </p> 62 </td> 63</tr> 64<tr> 65<td> 66 <p> 67 \ 68 </p> 69 </td> 70<td> 71 <p> 72 Specifies an escape sequence. 73 </p> 74 </td> 75</tr> 76</tbody> 77</table></div> 78<p> 79 An escape character followed by any character x, outputs that character unless 80 x is one of the escape sequences shown below. 81 </p> 82<div class="informaltable"><table class="table"> 83<colgroup> 84<col> 85<col> 86</colgroup> 87<thead><tr> 88<th> 89 <p> 90 Escape 91 </p> 92 </th> 93<th> 94 <p> 95 Meaning 96 </p> 97 </th> 98</tr></thead> 99<tbody> 100<tr> 101<td> 102 <p> 103 \a 104 </p> 105 </td> 106<td> 107 <p> 108 Outputs the bell character: '\a'. 109 </p> 110 </td> 111</tr> 112<tr> 113<td> 114 <p> 115 \e 116 </p> 117 </td> 118<td> 119 <p> 120 Outputs the ANSI escape character (code point 27). 121 </p> 122 </td> 123</tr> 124<tr> 125<td> 126 <p> 127 \f 128 </p> 129 </td> 130<td> 131 <p> 132 Outputs a form feed character: '\f' 133 </p> 134 </td> 135</tr> 136<tr> 137<td> 138 <p> 139 \n 140 </p> 141 </td> 142<td> 143 <p> 144 Outputs a newline character: '\n'. 145 </p> 146 </td> 147</tr> 148<tr> 149<td> 150 <p> 151 \r 152 </p> 153 </td> 154<td> 155 <p> 156 Outputs a carriage return character: '\r'. 157 </p> 158 </td> 159</tr> 160<tr> 161<td> 162 <p> 163 \t 164 </p> 165 </td> 166<td> 167 <p> 168 Outputs a tab character: '\t'. 169 </p> 170 </td> 171</tr> 172<tr> 173<td> 174 <p> 175 \v 176 </p> 177 </td> 178<td> 179 <p> 180 Outputs a vertical tab character: '\v'. 181 </p> 182 </td> 183</tr> 184<tr> 185<td> 186 <p> 187 \xDD 188 </p> 189 </td> 190<td> 191 <p> 192 Outputs the character whose hexadecimal code point is 0xDD 193 </p> 194 </td> 195</tr> 196<tr> 197<td> 198 <p> 199 \x{DDDD} 200 </p> 201 </td> 202<td> 203 <p> 204 Outputs the character whose hexadecimal code point is 0xDDDDD 205 </p> 206 </td> 207</tr> 208<tr> 209<td> 210 <p> 211 \cX 212 </p> 213 </td> 214<td> 215 <p> 216 Outputs the ANSI escape sequence "escape-X". 217 </p> 218 </td> 219</tr> 220<tr> 221<td> 222 <p> 223 \D 224 </p> 225 </td> 226<td> 227 <p> 228 If D is a decimal digit in the range 1-9, then outputs the text 229 that matched sub-expression D. 230 </p> 231 </td> 232</tr> 233</tbody> 234</table></div> 235</div> 236<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 237<td align="left"></td> 238<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p> 239 Distributed under the Boost Software License, Version 1.0. (See accompanying 240 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 241 </p> 242</div></td> 243</tr></table> 244<hr> 245<div class="spirit-nav"> 246<a accesskey="p" href="../format.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../format.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="perl_format.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 247</div> 248</body> 249</html> 250