[29] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
---|
| 2 | <html> |
---|
| 3 | <head> |
---|
| 4 | <title>Boost.Regex: Localisation</title> |
---|
| 5 | <meta name="generator" content="HTML Tidy, see www.w3.org"> |
---|
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
| 7 | <link rel="stylesheet" type="text/css" href="../../../boost.css"> |
---|
| 8 | </head> |
---|
| 9 | <body> |
---|
| 10 | <p></p> |
---|
| 11 | <table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0"> |
---|
| 12 | <tr> |
---|
| 13 | <td valign="top" width="300"> |
---|
| 14 | <h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../boost.png" border="0"></a></h3> |
---|
| 15 | </td> |
---|
| 16 | <td width="353"> |
---|
| 17 | <h1 align="center">Boost.Regex</h1> |
---|
| 18 | <h2 align="center">Localisation</h2> |
---|
| 19 | </td> |
---|
| 20 | <td width="50"> |
---|
| 21 | <h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3> |
---|
| 22 | </td> |
---|
| 23 | </tr> |
---|
| 24 | </table> |
---|
| 25 | <br> |
---|
| 26 | <br> |
---|
| 27 | <hr> |
---|
| 28 | <p>Boost.regex provides extensive support for run-time localization, the |
---|
| 29 | localization model used can be split into two parts: front-end and back-end.</p> |
---|
| 30 | <p>Front-end localization deals with everything which the user sees - error |
---|
| 31 | messages, and the regular expression syntax itself. For example a French |
---|
| 32 | application could change [[:word:]] to [[:mot:]] and \w to \m. Modifying the |
---|
| 33 | front end locale requires active support from the developer, by providing the |
---|
| 34 | library with a message catalogue to load, containing the localized strings. |
---|
| 35 | Front-end locale is affected by the LC_MESSAGES category only.</p> |
---|
| 36 | <p>Back-end localization deals with everything that occurs after the expression |
---|
| 37 | has been parsed - in other words everything that the user does not see or |
---|
| 38 | interact with directly. It deals with case conversion, collation, and character |
---|
| 39 | class membership. The back-end locale does not require any intervention from |
---|
| 40 | the developer - the library will acquire all the information it requires for |
---|
| 41 | the current locale from the underlying operating system / run time library. |
---|
| 42 | This means that if the program user does not interact with regular expressions |
---|
| 43 | directly - for example if the expressions are embedded in your C++ code - then |
---|
| 44 | no explicit localization is required, as the library will take care of |
---|
| 45 | everything for you. For example embedding the expression [[:word:]]+ in your |
---|
| 46 | code will always match a whole word, if the program is run on a machine with, |
---|
| 47 | for example, a Greek locale, then it will still match a whole word, but in |
---|
| 48 | Greek characters rather than Latin ones. The back-end locale is affected by the |
---|
| 49 | LC_TYPE and LC_COLLATE categories.</p> |
---|
| 50 | <p>There are three separate localization mechanisms supported by boost.regex:</p> |
---|
| 51 | <h3>Win32 localization model.</h3> |
---|
| 52 | <p>This is the default model when the library is compiled under Win32, and is |
---|
| 53 | encapsulated by the traits class w32_regex_traits. When this model is in effect |
---|
| 54 | each basic_regex object gets it's own LCID, by default this is the users |
---|
| 55 | default setting as returned by GetUserDefaultLCID, but you can call <EM>imbue</EM> |
---|
| 56 | on the basic_regex object to set it's locale to some other LCID if you wish. |
---|
| 57 | All the settings used by boost.regex are acquired directly from the operating |
---|
| 58 | system bypassing the C run time library. Front-end localization requires a |
---|
| 59 | resource dll, containing a string table with the user-defined strings. The |
---|
| 60 | traits class exports the function:</p> |
---|
| 61 | <p>static std::string set_message_catalogue(const std::string& s);</p> |
---|
| 62 | <p>which needs to be called with a string identifying the name of the resource |
---|
| 63 | dll, <i>before</i> your code compiles any regular expressions (but not |
---|
| 64 | necessarily before you construct any <i>basic_regex</i> instances):</p> |
---|
| 65 | <p> |
---|
| 66 | boost::w32_regex_traits<char>::set_message_catalogue("mydll.dll");</p> |
---|
| 67 | <p> |
---|
| 68 | The library provides full Unicode support under NT, under Windows 9x the |
---|
| 69 | library degrades gracefully - characters 0 to 255 are supported, the remainder |
---|
| 70 | are treated as "unknown" graphic characters.</p> |
---|
| 71 | <h3>C localization model.</h3> |
---|
| 72 | <p>This model has been deprecated in favor of the C++ localoe for all non-Windows |
---|
| 73 | compilers that support it. This locale is encapsulated by the traits |
---|
| 74 | class <i>c_regex_traits</i>, Win32 users can force this model to take effect by |
---|
| 75 | defining the pre-processor symbol BOOST_REGEX_USE_C_LOCALE. When this model is |
---|
| 76 | in effect there is a single global locale, as set by <i>setlocale</i>. All |
---|
| 77 | settings are acquired from your run time library, consequently Unicode support |
---|
| 78 | is dependent upon your run time library implementation.</p> |
---|
| 79 | <P>Front end localization is not supported.</P> |
---|
| 80 | <P>Note that calling <i>setlocale</i> invalidates all compiled regular |
---|
| 81 | expressions, calling <tt>setlocale(LC_ALL, "C")</tt> will make this library |
---|
| 82 | behave equivalent to most traditional regular expression libraries including |
---|
| 83 | version 1 of this library.</P> |
---|
| 84 | <h3>C++ localization model.</h3> |
---|
| 85 | <p>This model is the default for non-Windows compilers.</p> |
---|
| 86 | <P> |
---|
| 87 | When this model is in effect each instance of basic_regex<> has its own |
---|
| 88 | instance of std::locale, class basic_regex<> also has a member function <i>imbue</i> |
---|
| 89 | which allows the locale for the expression to be set on a per-instance basis. |
---|
| 90 | Front end localization requires a POSIX message catalogue, which will be loaded |
---|
| 91 | via the std::messages facet of the expression's locale, the traits class |
---|
| 92 | exports the symbol:</P> |
---|
| 93 | <p>static std::string set_message_catalogue(const std::string& s);</p> |
---|
| 94 | <p>which needs to be called with a string identifying the name of the message |
---|
| 95 | catalogue, <i>before</i> your code compiles any regular expressions (but not |
---|
| 96 | necessarily before you construct any <i>basic_regex</i> instances):</p> |
---|
| 97 | <p> |
---|
| 98 | boost::cpp_regex_traits<char>::set_message_catalogue("mycatalogue");</p> |
---|
| 99 | <p>Note that calling basic_regex<>::imbue will invalidate any expression |
---|
| 100 | currently compiled in that instance of basic_regex<>.</p> |
---|
| 101 | <P>Finally note that if you build the library with a non-default localization |
---|
| 102 | model, then the appropriate pre-processor symbol (BOOST_REGEX_USE_C_LOCALE or |
---|
| 103 | BOOST_REGEX_USE_CPP_LOCALE) must be defined both when you build the support |
---|
| 104 | library, and when you include <boost/regex.hpp> or |
---|
| 105 | <boost/cregex.hpp> in your code. The best way to ensure this is to add |
---|
| 106 | the #define to <boost/regex/user.hpp>.</P> |
---|
| 107 | <h3>Providing a message catalogue:</h3> |
---|
| 108 | <p> |
---|
| 109 | In order to localize the front end of the library, you need to provide the |
---|
| 110 | library with the appropriate message strings contained either in a resource |
---|
| 111 | dll's string table (Win32 model), or a POSIX message catalogue (C++ models). In |
---|
| 112 | the latter case the messages must appear in message set zero of the catalogue. |
---|
| 113 | The messages and their id's are as follows:<br> |
---|
| 114 | </p> |
---|
| 115 | <p></p> |
---|
| 116 | <table id="Table2" cellspacing="0" cellpadding="6" width="624" border="0"> |
---|
| 117 | <tr> |
---|
| 118 | <td valign="top" width="8%"> </td> |
---|
| 119 | <td valign="top" width="21%">Message id</td> |
---|
| 120 | <td valign="top" width="32%">Meaning</td> |
---|
| 121 | <td valign="top" width="29%">Default value</td> |
---|
| 122 | <td valign="top" width="9%"> </td> |
---|
| 123 | </tr> |
---|
| 124 | <tr> |
---|
| 125 | <td valign="top" width="8%"> </td> |
---|
| 126 | <td valign="top" width="21%">101</td> |
---|
| 127 | <td valign="top" width="32%">The character used to start a sub-expression.</td> |
---|
| 128 | <td valign="top" width="29%">"("</td> |
---|
| 129 | <td valign="top" width="9%"> </td> |
---|
| 130 | </tr> |
---|
| 131 | <tr> |
---|
| 132 | <td valign="top" width="8%"> </td> |
---|
| 133 | <td valign="top" width="21%">102</td> |
---|
| 134 | <td valign="top" width="32%">The character used to end a sub-expression |
---|
| 135 | declaration.</td> |
---|
| 136 | <td valign="top" width="29%">")"</td> |
---|
| 137 | <td valign="top" width="9%"> </td> |
---|
| 138 | </tr> |
---|
| 139 | <tr> |
---|
| 140 | <td valign="top" width="8%"> </td> |
---|
| 141 | <td valign="top" width="21%">103</td> |
---|
| 142 | <td valign="top" width="32%">The character used to denote an end of line |
---|
| 143 | assertion.</td> |
---|
| 144 | <td valign="top" width="29%">"$"</td> |
---|
| 145 | <td valign="top" width="9%"> </td> |
---|
| 146 | </tr> |
---|
| 147 | <tr> |
---|
| 148 | <td valign="top" width="8%"> </td> |
---|
| 149 | <td valign="top" width="21%">104</td> |
---|
| 150 | <td valign="top" width="32%">The character used to denote the start of line |
---|
| 151 | assertion.</td> |
---|
| 152 | <td valign="top" width="29%">"^"</td> |
---|
| 153 | <td valign="top" width="9%"> </td> |
---|
| 154 | </tr> |
---|
| 155 | <tr> |
---|
| 156 | <td valign="top" width="8%"> </td> |
---|
| 157 | <td valign="top" width="21%">105</td> |
---|
| 158 | <td valign="top" width="32%">The character used to denote the "match any character |
---|
| 159 | expression".</td> |
---|
| 160 | <td valign="top" width="29%">"."</td> |
---|
| 161 | <td valign="top" width="9%"> </td> |
---|
| 162 | </tr> |
---|
| 163 | <tr> |
---|
| 164 | <td valign="top" width="8%"> </td> |
---|
| 165 | <td valign="top" width="21%">106</td> |
---|
| 166 | <td valign="top" width="32%">The match zero or more times repetition operator.</td> |
---|
| 167 | <td valign="top" width="29%">"*"</td> |
---|
| 168 | <td valign="top" width="9%"> </td> |
---|
| 169 | </tr> |
---|
| 170 | <tr> |
---|
| 171 | <td valign="top" width="8%"> </td> |
---|
| 172 | <td valign="top" width="21%">107</td> |
---|
| 173 | <td valign="top" width="32%">The match one or more repetition operator.</td> |
---|
| 174 | <td valign="top" width="29%">"+"</td> |
---|
| 175 | <td valign="top" width="9%"> </td> |
---|
| 176 | </tr> |
---|
| 177 | <tr> |
---|
| 178 | <td valign="top" width="8%"> </td> |
---|
| 179 | <td valign="top" width="21%">108</td> |
---|
| 180 | <td valign="top" width="32%">The match zero or one repetition operator.</td> |
---|
| 181 | <td valign="top" width="29%">"?"</td> |
---|
| 182 | <td valign="top" width="9%"> </td> |
---|
| 183 | </tr> |
---|
| 184 | <tr> |
---|
| 185 | <td valign="top" width="8%"> </td> |
---|
| 186 | <td valign="top" width="21%">109</td> |
---|
| 187 | <td valign="top" width="32%">The character set opening character.</td> |
---|
| 188 | <td valign="top" width="29%">"["</td> |
---|
| 189 | <td valign="top" width="9%"> </td> |
---|
| 190 | </tr> |
---|
| 191 | <tr> |
---|
| 192 | <td valign="top" width="8%"> </td> |
---|
| 193 | <td valign="top" width="21%">110</td> |
---|
| 194 | <td valign="top" width="32%">The character set closing character.</td> |
---|
| 195 | <td valign="top" width="29%">"]"</td> |
---|
| 196 | <td valign="top" width="9%"> </td> |
---|
| 197 | </tr> |
---|
| 198 | <tr> |
---|
| 199 | <td valign="top" width="8%"> </td> |
---|
| 200 | <td valign="top" width="21%">111</td> |
---|
| 201 | <td valign="top" width="32%">The alternation operator.</td> |
---|
| 202 | <td valign="top" width="29%">"|"</td> |
---|
| 203 | <td valign="top" width="9%"> </td> |
---|
| 204 | </tr> |
---|
| 205 | <tr> |
---|
| 206 | <td valign="top" width="8%"> </td> |
---|
| 207 | <td valign="top" width="21%">112</td> |
---|
| 208 | <td valign="top" width="32%">The escape character.</td> |
---|
| 209 | <td valign="top" width="29%">"\\"</td> |
---|
| 210 | <td valign="top" width="9%"> </td> |
---|
| 211 | </tr> |
---|
| 212 | <tr> |
---|
| 213 | <td valign="top" width="8%"> </td> |
---|
| 214 | <td valign="top" width="21%">113</td> |
---|
| 215 | <td valign="top" width="32%">The hash character (not currently used).</td> |
---|
| 216 | <td valign="top" width="29%">"#"</td> |
---|
| 217 | <td valign="top" width="9%"> </td> |
---|
| 218 | </tr> |
---|
| 219 | <tr> |
---|
| 220 | <td valign="top" width="8%"> </td> |
---|
| 221 | <td valign="top" width="21%">114</td> |
---|
| 222 | <td valign="top" width="32%">The range operator.</td> |
---|
| 223 | <td valign="top" width="29%">"-"</td> |
---|
| 224 | <td valign="top" width="9%"> </td> |
---|
| 225 | </tr> |
---|
| 226 | <tr> |
---|
| 227 | <td valign="top" width="8%"> </td> |
---|
| 228 | <td valign="top" width="21%">115</td> |
---|
| 229 | <td valign="top" width="32%">The repetition operator opening character.</td> |
---|
| 230 | <td valign="top" width="29%">"{"</td> |
---|
| 231 | <td valign="top" width="9%"> </td> |
---|
| 232 | </tr> |
---|
| 233 | <tr> |
---|
| 234 | <td valign="top" width="8%"> </td> |
---|
| 235 | <td valign="top" width="21%">116</td> |
---|
| 236 | <td valign="top" width="32%">The repetition operator closing character.</td> |
---|
| 237 | <td valign="top" width="29%">"}"</td> |
---|
| 238 | <td valign="top" width="9%"> </td> |
---|
| 239 | </tr> |
---|
| 240 | <tr> |
---|
| 241 | <td valign="top" width="8%"> </td> |
---|
| 242 | <td valign="top" width="21%">117</td> |
---|
| 243 | <td valign="top" width="32%">The digit characters.</td> |
---|
| 244 | <td valign="top" width="29%">"0123456789"</td> |
---|
| 245 | <td valign="top" width="9%"> </td> |
---|
| 246 | </tr> |
---|
| 247 | <tr> |
---|
| 248 | <td valign="top" width="8%"> </td> |
---|
| 249 | <td valign="top" width="21%">118</td> |
---|
| 250 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 251 | character represents the word boundary assertion.</td> |
---|
| 252 | <td valign="top" width="29%">"b"</td> |
---|
| 253 | <td valign="top" width="9%"> </td> |
---|
| 254 | </tr> |
---|
| 255 | <tr> |
---|
| 256 | <td valign="top" width="8%"> </td> |
---|
| 257 | <td valign="top" width="21%">119</td> |
---|
| 258 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 259 | character represents the non-word boundary assertion.</td> |
---|
| 260 | <td valign="top" width="29%">"B"</td> |
---|
| 261 | <td valign="top" width="9%"> </td> |
---|
| 262 | </tr> |
---|
| 263 | <tr> |
---|
| 264 | <td valign="top" width="8%"> </td> |
---|
| 265 | <td valign="top" width="21%">120</td> |
---|
| 266 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 267 | character represents the word-start boundary assertion.</td> |
---|
| 268 | <td valign="top" width="29%">"<"</td> |
---|
| 269 | <td valign="top" width="9%"> </td> |
---|
| 270 | </tr> |
---|
| 271 | <tr> |
---|
| 272 | <td valign="top" width="8%"> </td> |
---|
| 273 | <td valign="top" width="21%">121</td> |
---|
| 274 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 275 | character represents the word-end boundary assertion.</td> |
---|
| 276 | <td valign="top" width="29%">">"</td> |
---|
| 277 | <td valign="top" width="9%"> </td> |
---|
| 278 | </tr> |
---|
| 279 | <tr> |
---|
| 280 | <td valign="top" width="8%"> </td> |
---|
| 281 | <td valign="top" width="21%">122</td> |
---|
| 282 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 283 | character represents any word character.</td> |
---|
| 284 | <td valign="top" width="29%">"w"</td> |
---|
| 285 | <td valign="top" width="9%"> </td> |
---|
| 286 | </tr> |
---|
| 287 | <tr> |
---|
| 288 | <td valign="top" width="8%"> </td> |
---|
| 289 | <td valign="top" width="21%">123</td> |
---|
| 290 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 291 | character represents a non-word character.</td> |
---|
| 292 | <td valign="top" width="29%">"W"</td> |
---|
| 293 | <td valign="top" width="9%"> </td> |
---|
| 294 | </tr> |
---|
| 295 | <tr> |
---|
| 296 | <td valign="top" width="8%"> </td> |
---|
| 297 | <td valign="top" width="21%">124</td> |
---|
| 298 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 299 | character represents a start of buffer assertion.</td> |
---|
| 300 | <td valign="top" width="29%">"`A"</td> |
---|
| 301 | <td valign="top" width="9%"> </td> |
---|
| 302 | </tr> |
---|
| 303 | <tr> |
---|
| 304 | <td valign="top" width="8%"> </td> |
---|
| 305 | <td valign="top" width="21%">125</td> |
---|
| 306 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 307 | character represents an end of buffer assertion.</td> |
---|
| 308 | <td valign="top" width="29%">"'z"</td> |
---|
| 309 | <td valign="top" width="9%"> </td> |
---|
| 310 | </tr> |
---|
| 311 | <tr> |
---|
| 312 | <td valign="top" width="8%"> </td> |
---|
| 313 | <td valign="top" width="21%">126</td> |
---|
| 314 | <td valign="top" width="32%">The newline character.</td> |
---|
| 315 | <td valign="top" width="29%">"\n"</td> |
---|
| 316 | <td valign="top" width="9%"> </td> |
---|
| 317 | </tr> |
---|
| 318 | <tr> |
---|
| 319 | <td valign="top" width="8%"> </td> |
---|
| 320 | <td valign="top" width="21%">127</td> |
---|
| 321 | <td valign="top" width="32%">The comma separator.</td> |
---|
| 322 | <td valign="top" width="29%">","</td> |
---|
| 323 | <td valign="top" width="9%"> </td> |
---|
| 324 | </tr> |
---|
| 325 | <tr> |
---|
| 326 | <td valign="top" width="8%"> </td> |
---|
| 327 | <td valign="top" width="21%">128</td> |
---|
| 328 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 329 | character represents the bell character.</td> |
---|
| 330 | <td valign="top" width="29%">"a"</td> |
---|
| 331 | <td valign="top" width="9%"> </td> |
---|
| 332 | </tr> |
---|
| 333 | <tr> |
---|
| 334 | <td valign="top" width="8%"> </td> |
---|
| 335 | <td valign="top" width="21%">129</td> |
---|
| 336 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 337 | character represents the form feed character.</td> |
---|
| 338 | <td valign="top" width="29%">"f"</td> |
---|
| 339 | <td valign="top" width="9%"> </td> |
---|
| 340 | </tr> |
---|
| 341 | <tr> |
---|
| 342 | <td valign="top" width="8%"> </td> |
---|
| 343 | <td valign="top" width="21%">130</td> |
---|
| 344 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 345 | character represents the newline character.</td> |
---|
| 346 | <td valign="top" width="29%">"n"</td> |
---|
| 347 | <td valign="top" width="9%"> </td> |
---|
| 348 | </tr> |
---|
| 349 | <tr> |
---|
| 350 | <td valign="top" width="8%"> </td> |
---|
| 351 | <td valign="top" width="21%">131</td> |
---|
| 352 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 353 | character represents the carriage return character.</td> |
---|
| 354 | <td valign="top" width="29%">"r"</td> |
---|
| 355 | <td valign="top" width="9%"> </td> |
---|
| 356 | </tr> |
---|
| 357 | <tr> |
---|
| 358 | <td valign="top" width="8%"> </td> |
---|
| 359 | <td valign="top" width="21%">132</td> |
---|
| 360 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 361 | character represents the tab character.</td> |
---|
| 362 | <td valign="top" width="29%">"t"</td> |
---|
| 363 | <td valign="top" width="9%"> </td> |
---|
| 364 | </tr> |
---|
| 365 | <tr> |
---|
| 366 | <td valign="top" width="8%"> </td> |
---|
| 367 | <td valign="top" width="21%">133</td> |
---|
| 368 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 369 | character represents the vertical tab character.</td> |
---|
| 370 | <td valign="top" width="29%">"v"</td> |
---|
| 371 | <td valign="top" width="9%"> </td> |
---|
| 372 | </tr> |
---|
| 373 | <tr> |
---|
| 374 | <td valign="top" width="8%"> </td> |
---|
| 375 | <td valign="top" width="21%">134</td> |
---|
| 376 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 377 | character represents the start of a hexadecimal character constant.</td> |
---|
| 378 | <td valign="top" width="29%">"x"</td> |
---|
| 379 | <td valign="top" width="9%"> </td> |
---|
| 380 | </tr> |
---|
| 381 | <tr> |
---|
| 382 | <td valign="top" width="8%"> </td> |
---|
| 383 | <td valign="top" width="21%">135</td> |
---|
| 384 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 385 | character represents the start of an ASCII escape character.</td> |
---|
| 386 | <td valign="top" width="29%">"c"</td> |
---|
| 387 | <td valign="top" width="9%"> </td> |
---|
| 388 | </tr> |
---|
| 389 | <tr> |
---|
| 390 | <td valign="top" width="8%"> </td> |
---|
| 391 | <td valign="top" width="21%">136</td> |
---|
| 392 | <td valign="top" width="32%">The colon character.</td> |
---|
| 393 | <td valign="top" width="29%">":"</td> |
---|
| 394 | <td valign="top" width="9%"> </td> |
---|
| 395 | </tr> |
---|
| 396 | <tr> |
---|
| 397 | <td valign="top" width="8%"> </td> |
---|
| 398 | <td valign="top" width="21%">137</td> |
---|
| 399 | <td valign="top" width="32%">The equals character.</td> |
---|
| 400 | <td valign="top" width="29%">"="</td> |
---|
| 401 | <td valign="top" width="9%"> </td> |
---|
| 402 | </tr> |
---|
| 403 | <tr> |
---|
| 404 | <td valign="top" width="8%"> </td> |
---|
| 405 | <td valign="top" width="21%">138</td> |
---|
| 406 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 407 | character represents the ASCII escape character.</td> |
---|
| 408 | <td valign="top" width="29%">"e"</td> |
---|
| 409 | <td valign="top" width="9%"> </td> |
---|
| 410 | </tr> |
---|
| 411 | <tr> |
---|
| 412 | <td valign="top" width="8%"> </td> |
---|
| 413 | <td valign="top" width="21%">139</td> |
---|
| 414 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 415 | character represents any lower case character.</td> |
---|
| 416 | <td valign="top" width="29%">"l"</td> |
---|
| 417 | <td valign="top" width="9%"> </td> |
---|
| 418 | </tr> |
---|
| 419 | <tr> |
---|
| 420 | <td valign="top" width="8%"> </td> |
---|
| 421 | <td valign="top" width="21%">140</td> |
---|
| 422 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 423 | character represents any non-lower case character.</td> |
---|
| 424 | <td valign="top" width="29%">"L"</td> |
---|
| 425 | <td valign="top" width="9%"> </td> |
---|
| 426 | </tr> |
---|
| 427 | <tr> |
---|
| 428 | <td valign="top" width="8%"> </td> |
---|
| 429 | <td valign="top" width="21%">141</td> |
---|
| 430 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 431 | character represents any upper case character.</td> |
---|
| 432 | <td valign="top" width="29%">"u"</td> |
---|
| 433 | <td valign="top" width="9%"> </td> |
---|
| 434 | </tr> |
---|
| 435 | <tr> |
---|
| 436 | <td valign="top" width="8%"> </td> |
---|
| 437 | <td valign="top" width="21%">142</td> |
---|
| 438 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 439 | character represents any non-upper case character.</td> |
---|
| 440 | <td valign="top" width="29%">"U"</td> |
---|
| 441 | <td valign="top" width="9%"> </td> |
---|
| 442 | </tr> |
---|
| 443 | <tr> |
---|
| 444 | <td valign="top" width="8%"> </td> |
---|
| 445 | <td valign="top" width="21%">143</td> |
---|
| 446 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 447 | character represents any space character.</td> |
---|
| 448 | <td valign="top" width="29%">"s"</td> |
---|
| 449 | <td valign="top" width="9%"> </td> |
---|
| 450 | </tr> |
---|
| 451 | <tr> |
---|
| 452 | <td valign="top" width="8%"> </td> |
---|
| 453 | <td valign="top" width="21%">144</td> |
---|
| 454 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 455 | character represents any non-space character.</td> |
---|
| 456 | <td valign="top" width="29%">"S"</td> |
---|
| 457 | <td valign="top" width="9%"> </td> |
---|
| 458 | </tr> |
---|
| 459 | <tr> |
---|
| 460 | <td valign="top" width="8%"> </td> |
---|
| 461 | <td valign="top" width="21%">145</td> |
---|
| 462 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 463 | character represents any digit character.</td> |
---|
| 464 | <td valign="top" width="29%">"d"</td> |
---|
| 465 | <td valign="top" width="9%"> </td> |
---|
| 466 | </tr> |
---|
| 467 | <tr> |
---|
| 468 | <td valign="top" width="8%"> </td> |
---|
| 469 | <td valign="top" width="21%">146</td> |
---|
| 470 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 471 | character represents any non-digit character.</td> |
---|
| 472 | <td valign="top" width="29%">"D"</td> |
---|
| 473 | <td valign="top" width="9%"> </td> |
---|
| 474 | </tr> |
---|
| 475 | <tr> |
---|
| 476 | <td valign="top" width="8%"> </td> |
---|
| 477 | <td valign="top" width="21%">147</td> |
---|
| 478 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 479 | character represents the end quote operator.</td> |
---|
| 480 | <td valign="top" width="29%">"E"</td> |
---|
| 481 | <td valign="top" width="9%"> </td> |
---|
| 482 | </tr> |
---|
| 483 | <tr> |
---|
| 484 | <td valign="top" width="8%"> </td> |
---|
| 485 | <td valign="top" width="21%">148</td> |
---|
| 486 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 487 | character represents the start quote operator.</td> |
---|
| 488 | <td valign="top" width="29%">"Q"</td> |
---|
| 489 | <td valign="top" width="9%"> </td> |
---|
| 490 | </tr> |
---|
| 491 | <tr> |
---|
| 492 | <td valign="top" width="8%"> </td> |
---|
| 493 | <td valign="top" width="21%">149</td> |
---|
| 494 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 495 | character represents a Unicode combining character sequence.</td> |
---|
| 496 | <td valign="top" width="29%">"X"</td> |
---|
| 497 | <td valign="top" width="9%"> </td> |
---|
| 498 | </tr> |
---|
| 499 | <tr> |
---|
| 500 | <td valign="top" width="8%"> </td> |
---|
| 501 | <td valign="top" width="21%">150</td> |
---|
| 502 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 503 | character represents any single character.</td> |
---|
| 504 | <td valign="top" width="29%">"C"</td> |
---|
| 505 | <td valign="top" width="9%"> </td> |
---|
| 506 | </tr> |
---|
| 507 | <tr> |
---|
| 508 | <td valign="top" width="8%"> </td> |
---|
| 509 | <td valign="top" width="21%">151</td> |
---|
| 510 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 511 | character represents end of buffer operator.</td> |
---|
| 512 | <td valign="top" width="29%">"Z"</td> |
---|
| 513 | <td valign="top" width="9%"> </td> |
---|
| 514 | </tr> |
---|
| 515 | <tr> |
---|
| 516 | <td valign="top" width="8%"> </td> |
---|
| 517 | <td valign="top" width="21%">152</td> |
---|
| 518 | <td valign="top" width="32%">The character which when preceded by an escape |
---|
| 519 | character represents the continuation assertion.</td> |
---|
| 520 | <td valign="top" width="29%">"G"</td> |
---|
| 521 | <td valign="top" width="9%"> </td> |
---|
| 522 | </tr> |
---|
| 523 | <tr> |
---|
| 524 | <td> </td> |
---|
| 525 | <td>153</td> |
---|
| 526 | <td>The character which when preceeded by (? indicates a zero width negated |
---|
| 527 | forward lookahead assert.</td> |
---|
| 528 | <td>!</td> |
---|
| 529 | <td> </td> |
---|
| 530 | </tr> |
---|
| 531 | </table> |
---|
| 532 | <br> |
---|
| 533 | <br> |
---|
| 534 | <p>Custom error messages are loaded as follows: </p> |
---|
| 535 | <p></p> |
---|
| 536 | <table id="Table3" cellspacing="0" cellpadding="7" width="624" border="0"> |
---|
| 537 | <tr> |
---|
| 538 | <td valign="top" width="8%"> </td> |
---|
| 539 | <td valign="top" width="22%">Message ID</td> |
---|
| 540 | <td valign="top" width="32%">Error message ID</td> |
---|
| 541 | <td valign="top" width="31%">Default string</td> |
---|
| 542 | <td valign="top" width="7%"> </td> |
---|
| 543 | </tr> |
---|
| 544 | <tr> |
---|
| 545 | <td valign="top" width="8%"> </td> |
---|
| 546 | <td valign="top" width="22%">201</td> |
---|
| 547 | <td valign="top" width="32%">REG_NOMATCH</td> |
---|
| 548 | <td valign="top" width="31%">"No match"</td> |
---|
| 549 | <td valign="top" width="7%"> </td> |
---|
| 550 | </tr> |
---|
| 551 | <tr> |
---|
| 552 | <td valign="top" width="8%"> </td> |
---|
| 553 | <td valign="top" width="22%">202</td> |
---|
| 554 | <td valign="top" width="32%">REG_BADPAT</td> |
---|
| 555 | <td valign="top" width="31%">"Invalid regular expression"</td> |
---|
| 556 | <td valign="top" width="7%"> </td> |
---|
| 557 | </tr> |
---|
| 558 | <tr> |
---|
| 559 | <td valign="top" width="8%"> </td> |
---|
| 560 | <td valign="top" width="22%">203</td> |
---|
| 561 | <td valign="top" width="32%">REG_ECOLLATE</td> |
---|
| 562 | <td valign="top" width="31%">"Invalid collation character"</td> |
---|
| 563 | <td valign="top" width="7%"> </td> |
---|
| 564 | </tr> |
---|
| 565 | <tr> |
---|
| 566 | <td valign="top" width="8%"> </td> |
---|
| 567 | <td valign="top" width="22%">204</td> |
---|
| 568 | <td valign="top" width="32%">REG_ECTYPE</td> |
---|
| 569 | <td valign="top" width="31%">"Invalid character class name"</td> |
---|
| 570 | <td valign="top" width="7%"> </td> |
---|
| 571 | </tr> |
---|
| 572 | <tr> |
---|
| 573 | <td valign="top" width="8%"> </td> |
---|
| 574 | <td valign="top" width="22%">205</td> |
---|
| 575 | <td valign="top" width="32%">REG_EESCAPE</td> |
---|
| 576 | <td valign="top" width="31%">"Trailing backslash"</td> |
---|
| 577 | <td valign="top" width="7%"> </td> |
---|
| 578 | </tr> |
---|
| 579 | <tr> |
---|
| 580 | <td valign="top" width="8%"> </td> |
---|
| 581 | <td valign="top" width="22%">206</td> |
---|
| 582 | <td valign="top" width="32%">REG_ESUBREG</td> |
---|
| 583 | <td valign="top" width="31%">"Invalid back reference"</td> |
---|
| 584 | <td valign="top" width="7%"> </td> |
---|
| 585 | </tr> |
---|
| 586 | <tr> |
---|
| 587 | <td valign="top" width="8%"> </td> |
---|
| 588 | <td valign="top" width="22%">207</td> |
---|
| 589 | <td valign="top" width="32%">REG_EBRACK</td> |
---|
| 590 | <td valign="top" width="31%">"Unmatched [ or [^"</td> |
---|
| 591 | <td valign="top" width="7%"> </td> |
---|
| 592 | </tr> |
---|
| 593 | <tr> |
---|
| 594 | <td valign="top" width="8%"> </td> |
---|
| 595 | <td valign="top" width="22%">208</td> |
---|
| 596 | <td valign="top" width="32%">REG_EPAREN</td> |
---|
| 597 | <td valign="top" width="31%">"Unmatched ( or \\("</td> |
---|
| 598 | <td valign="top" width="7%"> </td> |
---|
| 599 | </tr> |
---|
| 600 | <tr> |
---|
| 601 | <td valign="top" width="8%"> </td> |
---|
| 602 | <td valign="top" width="22%">209</td> |
---|
| 603 | <td valign="top" width="32%">REG_EBRACE</td> |
---|
| 604 | <td valign="top" width="31%">"Unmatched \\{"</td> |
---|
| 605 | <td valign="top" width="7%"> </td> |
---|
| 606 | </tr> |
---|
| 607 | <tr> |
---|
| 608 | <td valign="top" width="8%"> </td> |
---|
| 609 | <td valign="top" width="22%">210</td> |
---|
| 610 | <td valign="top" width="32%">REG_BADBR</td> |
---|
| 611 | <td valign="top" width="31%">"Invalid content of \\{\\}"</td> |
---|
| 612 | <td valign="top" width="7%"> </td> |
---|
| 613 | </tr> |
---|
| 614 | <tr> |
---|
| 615 | <td valign="top" width="8%"> </td> |
---|
| 616 | <td valign="top" width="22%">211</td> |
---|
| 617 | <td valign="top" width="32%">REG_ERANGE</td> |
---|
| 618 | <td valign="top" width="31%">"Invalid range end"</td> |
---|
| 619 | <td valign="top" width="7%"> </td> |
---|
| 620 | </tr> |
---|
| 621 | <tr> |
---|
| 622 | <td valign="top" width="8%"> </td> |
---|
| 623 | <td valign="top" width="22%">212</td> |
---|
| 624 | <td valign="top" width="32%">REG_ESPACE</td> |
---|
| 625 | <td valign="top" width="31%">"Memory exhausted"</td> |
---|
| 626 | <td valign="top" width="7%"> </td> |
---|
| 627 | </tr> |
---|
| 628 | <tr> |
---|
| 629 | <td valign="top" width="8%"> </td> |
---|
| 630 | <td valign="top" width="22%">213</td> |
---|
| 631 | <td valign="top" width="32%">REG_BADRPT</td> |
---|
| 632 | <td valign="top" width="31%">"Invalid preceding regular expression"</td> |
---|
| 633 | <td valign="top" width="7%"> </td> |
---|
| 634 | </tr> |
---|
| 635 | <tr> |
---|
| 636 | <td valign="top" width="8%"> </td> |
---|
| 637 | <td valign="top" width="22%">214</td> |
---|
| 638 | <td valign="top" width="32%">REG_EEND</td> |
---|
| 639 | <td valign="top" width="31%">"Premature end of regular expression"</td> |
---|
| 640 | <td valign="top" width="7%"> </td> |
---|
| 641 | </tr> |
---|
| 642 | <tr> |
---|
| 643 | <td valign="top" width="8%"> </td> |
---|
| 644 | <td valign="top" width="22%">215</td> |
---|
| 645 | <td valign="top" width="32%">REG_ESIZE</td> |
---|
| 646 | <td valign="top" width="31%">"Regular expression too big"</td> |
---|
| 647 | <td valign="top" width="7%"> </td> |
---|
| 648 | </tr> |
---|
| 649 | <tr> |
---|
| 650 | <td valign="top" width="8%"> </td> |
---|
| 651 | <td valign="top" width="22%">216</td> |
---|
| 652 | <td valign="top" width="32%">REG_ERPAREN</td> |
---|
| 653 | <td valign="top" width="31%">"Unmatched ) or \\)"</td> |
---|
| 654 | <td valign="top" width="7%"> </td> |
---|
| 655 | </tr> |
---|
| 656 | <tr> |
---|
| 657 | <td valign="top" width="8%"> </td> |
---|
| 658 | <td valign="top" width="22%">217</td> |
---|
| 659 | <td valign="top" width="32%">REG_EMPTY</td> |
---|
| 660 | <td valign="top" width="31%">"Empty expression"</td> |
---|
| 661 | <td valign="top" width="7%"> </td> |
---|
| 662 | </tr> |
---|
| 663 | <tr> |
---|
| 664 | <td valign="top" width="8%"> </td> |
---|
| 665 | <td valign="top" width="22%">218</td> |
---|
| 666 | <td valign="top" width="32%">REG_E_UNKNOWN</td> |
---|
| 667 | <td valign="top" width="31%">"Unknown error"</td> |
---|
| 668 | <td valign="top" width="7%"> </td> |
---|
| 669 | </tr> |
---|
| 670 | </table> |
---|
| 671 | <br> |
---|
| 672 | <br> |
---|
| 673 | <p>Custom character class names are loaded as followed: </p> |
---|
| 674 | <p></p> |
---|
| 675 | <table id="Table4" cellspacing="0" cellpadding="7" width="624" border="0"> |
---|
| 676 | <tr> |
---|
| 677 | <td valign="top" width="8%"> </td> |
---|
| 678 | <td valign="top" width="22%">Message ID</td> |
---|
| 679 | <td valign="top" width="32%">Description</td> |
---|
| 680 | <td valign="top" width="31%">Equivalent default class name</td> |
---|
| 681 | <td valign="top" width="7%"> </td> |
---|
| 682 | </tr> |
---|
| 683 | <tr> |
---|
| 684 | <td valign="top" width="8%"> </td> |
---|
| 685 | <td valign="top" width="22%">300</td> |
---|
| 686 | <td valign="top" width="32%">The character class name for alphanumeric characters.</td> |
---|
| 687 | <td valign="top" width="31%">"alnum"</td> |
---|
| 688 | <td valign="top" width="7%"> </td> |
---|
| 689 | </tr> |
---|
| 690 | <tr> |
---|
| 691 | <td valign="top" width="8%"> </td> |
---|
| 692 | <td valign="top" width="22%">301</td> |
---|
| 693 | <td valign="top" width="32%">The character class name for alphabetic characters.</td> |
---|
| 694 | <td valign="top" width="31%">"alpha"</td> |
---|
| 695 | <td valign="top" width="7%"> </td> |
---|
| 696 | </tr> |
---|
| 697 | <tr> |
---|
| 698 | <td valign="top" width="8%"> </td> |
---|
| 699 | <td valign="top" width="22%">302</td> |
---|
| 700 | <td valign="top" width="32%">The character class name for control characters.</td> |
---|
| 701 | <td valign="top" width="31%">"cntrl"</td> |
---|
| 702 | <td valign="top" width="7%"> </td> |
---|
| 703 | </tr> |
---|
| 704 | <tr> |
---|
| 705 | <td valign="top" width="8%"> </td> |
---|
| 706 | <td valign="top" width="22%">303</td> |
---|
| 707 | <td valign="top" width="32%">The character class name for digit characters.</td> |
---|
| 708 | <td valign="top" width="31%">"digit"</td> |
---|
| 709 | <td valign="top" width="7%"> </td> |
---|
| 710 | </tr> |
---|
| 711 | <tr> |
---|
| 712 | <td valign="top" width="8%"> </td> |
---|
| 713 | <td valign="top" width="22%">304</td> |
---|
| 714 | <td valign="top" width="32%">The character class name for graphics characters.</td> |
---|
| 715 | <td valign="top" width="31%">"graph"</td> |
---|
| 716 | <td valign="top" width="7%"> </td> |
---|
| 717 | </tr> |
---|
| 718 | <tr> |
---|
| 719 | <td valign="top" width="8%"> </td> |
---|
| 720 | <td valign="top" width="22%">305</td> |
---|
| 721 | <td valign="top" width="32%">The character class name for lower case characters.</td> |
---|
| 722 | <td valign="top" width="31%">"lower"</td> |
---|
| 723 | <td valign="top" width="7%"> </td> |
---|
| 724 | </tr> |
---|
| 725 | <tr> |
---|
| 726 | <td valign="top" width="8%"> </td> |
---|
| 727 | <td valign="top" width="22%">306</td> |
---|
| 728 | <td valign="top" width="32%">The character class name for printable characters.</td> |
---|
| 729 | <td valign="top" width="31%">"print"</td> |
---|
| 730 | <td valign="top" width="7%"> </td> |
---|
| 731 | </tr> |
---|
| 732 | <tr> |
---|
| 733 | <td valign="top" width="8%"> </td> |
---|
| 734 | <td valign="top" width="22%">307</td> |
---|
| 735 | <td valign="top" width="32%">The character class name for punctuation characters.</td> |
---|
| 736 | <td valign="top" width="31%">"punct"</td> |
---|
| 737 | <td valign="top" width="7%"> </td> |
---|
| 738 | </tr> |
---|
| 739 | <tr> |
---|
| 740 | <td valign="top" width="8%"> </td> |
---|
| 741 | <td valign="top" width="22%">308</td> |
---|
| 742 | <td valign="top" width="32%">The character class name for space characters.</td> |
---|
| 743 | <td valign="top" width="31%">"space"</td> |
---|
| 744 | <td valign="top" width="7%"> </td> |
---|
| 745 | </tr> |
---|
| 746 | <tr> |
---|
| 747 | <td valign="top" width="8%"> </td> |
---|
| 748 | <td valign="top" width="22%">309</td> |
---|
| 749 | <td valign="top" width="32%">The character class name for upper case characters.</td> |
---|
| 750 | <td valign="top" width="31%">"upper"</td> |
---|
| 751 | <td valign="top" width="7%"> </td> |
---|
| 752 | </tr> |
---|
| 753 | <tr> |
---|
| 754 | <td valign="top" width="8%"> </td> |
---|
| 755 | <td valign="top" width="22%">310</td> |
---|
| 756 | <td valign="top" width="32%">The character class name for hexadecimal characters.</td> |
---|
| 757 | <td valign="top" width="31%">"xdigit"</td> |
---|
| 758 | <td valign="top" width="7%"> </td> |
---|
| 759 | </tr> |
---|
| 760 | <tr> |
---|
| 761 | <td valign="top" width="8%"> </td> |
---|
| 762 | <td valign="top" width="22%">311</td> |
---|
| 763 | <td valign="top" width="32%">The character class name for blank characters.</td> |
---|
| 764 | <td valign="top" width="31%">"blank"</td> |
---|
| 765 | <td valign="top" width="7%"> </td> |
---|
| 766 | </tr> |
---|
| 767 | <tr> |
---|
| 768 | <td valign="top" width="8%"> </td> |
---|
| 769 | <td valign="top" width="22%">312</td> |
---|
| 770 | <td valign="top" width="32%">The character class name for word characters.</td> |
---|
| 771 | <td valign="top" width="31%">"word"</td> |
---|
| 772 | <td valign="top" width="7%"> </td> |
---|
| 773 | </tr> |
---|
| 774 | <tr> |
---|
| 775 | <td valign="top" width="8%"> </td> |
---|
| 776 | <td valign="top" width="22%">313</td> |
---|
| 777 | <td valign="top" width="32%">The character class name for Unicode characters.</td> |
---|
| 778 | <td valign="top" width="31%">"unicode"</td> |
---|
| 779 | <td valign="top" width="7%"> </td> |
---|
| 780 | </tr> |
---|
| 781 | </table> |
---|
| 782 | <br> |
---|
| 783 | <br> |
---|
| 784 | <p>Finally, custom collating element names are loaded starting from message id |
---|
| 785 | 400, and terminating when the first load thereafter fails. Each message looks |
---|
| 786 | something like: "tagname string" where <i>tagname</i> is the name used inside |
---|
| 787 | [[.tagname.]] and <i>string</i> is the actual text of the collating element. |
---|
| 788 | Note that the value of collating element [[.zero.]] is used for the conversion |
---|
| 789 | of strings to numbers - if you replace this with another value then that will |
---|
| 790 | be used for string parsing - for example use the Unicode character 0x0660 for |
---|
| 791 | [[.zero.]] if you want to use Unicode Arabic-Indic digits in your regular |
---|
| 792 | expressions in place of Latin digits.</p> |
---|
| 793 | <p>Note that the POSIX defined names for character classes and collating elements |
---|
| 794 | are always available - even if custom names are defined, in contrast, custom |
---|
| 795 | error messages, and custom syntax messages replace the default ones.</p> |
---|
| 796 | <p></p> |
---|
| 797 | <hr> |
---|
| 798 | <p>Revised |
---|
| 799 | <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> |
---|
| 800 | 26 June 2004 |
---|
| 801 | <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> |
---|
| 802 | <p><i>© Copyright John Maddock 1998- |
---|
| 803 | <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 2004<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p> |
---|
| 804 | <P><I>Use, modification and distribution are subject to the Boost Software License, |
---|
| 805 | Version 1.0. (See accompanying file <A href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> |
---|
| 806 | or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P> |
---|
| 807 | </body> |
---|
| 808 | </html> |
---|