Imported Upstream version 1.49.0
[platform/upstream/boost.git] / libs / regex / doc / html / boost_regex / background_information / locale.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Localization</title>
5 <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="../../index.html" title="Boost.Regex">
8 <link rel="up" href="../background_information.html" title="Background Information">
9 <link rel="prev" href="headers.html" title="Headers">
10 <link rel="next" href="thread_safety.html" title="Thread Safety">
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="headers.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.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="thread_safety.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.background_information.locale"></a><a class="link" href="locale.html" title="Localization">Localization</a>
28 </h3></div></div></div>
29 <p>
30         Boost.Regex provides extensive support for run-time localization, the localization
31         model used can be split into two parts: front-end and back-end.
32       </p>
33 <p>
34         Front-end localization deals with everything which the user sees - error
35         messages, and the regular expression syntax itself. For example a French
36         application could change [[:word:]] to [[:mot:]] and \w to \m. Modifying
37         the front end locale requires active support from the developer, by providing
38         the library with a message catalogue to load, containing the localized strings.
39         Front-end locale is affected by the LC_MESSAGES category only.
40       </p>
41 <p>
42         Back-end localization deals with everything that occurs after the expression
43         has been parsed - in other words everything that the user does not see or
44         interact with directly. It deals with case conversion, collation, and character
45         class membership. The back-end locale does not require any intervention from
46         the developer - the library will acquire all the information it requires
47         for the current locale from the underlying operating system / run time library.
48         This means that if the program user does not interact with regular expressions
49         directly - for example if the expressions are embedded in your C++ code -
50         then no explicit localization is required, as the library will take care
51         of everything for you. For example embedding the expression [[:word:]]+ in
52         your code will always match a whole word, if the program is run on a machine
53         with, for example, a Greek locale, then it will still match a whole word,
54         but in Greek characters rather than Latin ones. The back-end locale is affected
55         by the LC_TYPE and LC_COLLATE categories.
56       </p>
57 <p>
58         There are three separate localization mechanisms supported by Boost.Regex:
59       </p>
60 <h5>
61 <a name="boost_regex.background_information.locale.h0"></a>
62         <span><a name="boost_regex.background_information.locale.win32_localization_model_"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.win32_localization_model_">Win32
63         localization model.</a>
64       </h5>
65 <p>
66         This is the default model when the library is compiled under Win32, and is
67         encapsulated by the traits class <code class="computeroutput"><span class="identifier">w32_regex_traits</span></code>.
68         When this model is in effect each <a class="link" href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a> object gets it's own
69         LCID, by default this is the users default setting as returned by GetUserDefaultLCID,
70         but you can call imbue on the <code class="computeroutput"><span class="identifier">basic_regex</span></code>
71         object to set it's locale to some other LCID if you wish. All the settings
72         used by Boost.Regex are acquired directly from the operating system bypassing
73         the C run time library. Front-end localization requires a resource dll, containing
74         a string table with the user-defined strings. The traits class exports the
75         function:
76       </p>
77 <pre class="programlisting"><span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">set_message_catalogue</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">s</span><span class="special">);</span>
78 </pre>
79 <p>
80         which needs to be called with a string identifying the name of the resource
81         dll, before your code compiles any regular expressions (but not necessarily
82         before you construct any <code class="computeroutput"><span class="identifier">basic_regex</span></code>
83         instances):
84       </p>
85 <pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">w32_regex_traits</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;::</span><span class="identifier">set_message_catalogue</span><span class="special">(</span><span class="string">"mydll.dll"</span><span class="special">);</span>
86 </pre>
87 <p>
88         The library provides full Unicode support under NT, under Windows 9x the
89         library degrades gracefully - characters 0 to 255 are supported, the remainder
90         are treated as "unknown" graphic characters.
91       </p>
92 <h5>
93 <a name="boost_regex.background_information.locale.h1"></a>
94         <span><a name="boost_regex.background_information.locale.c_localization_model_"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.c_localization_model_">C
95         localization model.</a>
96       </h5>
97 <p>
98         This model has been deprecated in favor of the C++ locale for all non-Windows
99         compilers that support it. This locale is encapsulated by the traits class
100         <code class="computeroutput"><span class="identifier">c_regex_traits</span></code>, Win32 users
101         can force this model to take effect by defining the pre-processor symbol
102         BOOST_REGEX_USE_C_LOCALE. When this model is in effect there is a single
103         global locale, as set by <code class="computeroutput"><span class="identifier">setlocale</span></code>.
104         All settings are acquired from your run time library, consequently Unicode
105         support is dependent upon your run time library implementation.
106       </p>
107 <p>
108         Front end localization is not supported.
109       </p>
110 <p>
111         Note that calling setlocale invalidates all compiled regular expressions,
112         calling <code class="computeroutput"><span class="identifier">setlocale</span><span class="special">(</span><span class="identifier">LC_ALL</span><span class="special">,</span> <span class="string">"C"</span><span class="special">)</span></code>
113         will make this library behave equivalent to most traditional regular expression
114         libraries including version 1 of this library.
115       </p>
116 <h5>
117 <a name="boost_regex.background_information.locale.h2"></a>
118         <span><a name="boost_regex.background_information.locale.c___localization_model_"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.c___localization_model_">C++
119         localization model.</a>
120       </h5>
121 <p>
122         This model is the default for non-Windows compilers.
123       </p>
124 <p>
125         When this model is in effect each instance of <a class="link" href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a> has its own instance
126         of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span></code>, class <a class="link" href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a> also has a member function
127         <code class="computeroutput"><span class="identifier">imbue</span></code> which allows the locale
128         for the expression to be set on a per-instance basis. Front end localization
129         requires a POSIX message catalogue, which will be loaded via the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">messages</span></code>
130         facet of the expression's locale, the traits class exports the symbol:
131       </p>
132 <pre class="programlisting"><span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">set_message_catalogue</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">s</span><span class="special">);</span>
133 </pre>
134 <p>
135         which needs to be called with a string identifying the name of the message
136         catalogue, before your code compiles any regular expressions (but not necessarily
137         before you construct any basic_regex instances):
138       </p>
139 <pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">cpp_regex_traits</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;::</span><span class="identifier">set_message_catalogue</span><span class="special">(</span><span class="string">"mycatalogue"</span><span class="special">);</span>
140 </pre>
141 <p>
142         Note that calling <code class="computeroutput"><span class="identifier">basic_regex</span><span class="special">&lt;&gt;::</span><span class="identifier">imbue</span></code>
143         will invalidate any expression currently compiled in that instance of <a class="link" href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a>.
144       </p>
145 <p>
146         Finally note that if you build the library with a non-default localization
147         model, then the appropriate pre-processor symbol (BOOST_REGEX_USE_C_LOCALE
148         or BOOST_REGEX_USE_CPP_LOCALE) must be defined both when you build the support
149         library, and when you include <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
150         or <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">cregex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
151         in your code. The best way to ensure this is to add the #define to <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">/</span><span class="identifier">user</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>.
152       </p>
153 <h5>
154 <a name="boost_regex.background_information.locale.h3"></a>
155         <span><a name="boost_regex.background_information.locale.providing_a_message_catalogue"></a></span><a class="link" href="locale.html#boost_regex.background_information.locale.providing_a_message_catalogue">Providing
156         a message catalogue</a>
157       </h5>
158 <p>
159         In order to localize the front end of the library, you need to provide the
160         library with the appropriate message strings contained either in a resource
161         dll's string table (Win32 model), or a POSIX message catalogue (C++ models).
162         In the latter case the messages must appear in message set zero of the catalogue.
163         The messages and their id's are as follows:
164       </p>
165 <div class="informaltable"><table class="table">
166 <colgroup>
167 <col>
168 <col>
169 <col>
170 </colgroup>
171 <thead><tr>
172 <th>
173                 <p>
174                   Message
175                 </p>
176               </th>
177 <th>
178                 <p>
179                   id
180                 </p>
181               </th>
182 <th>
183                 <p>
184                   Meaning
185                 </p>
186               </th>
187 <th>
188                 <p>
189                   Default value
190                 </p>
191               </th>
192 </tr></thead>
193 <tbody>
194 <tr>
195 <td>
196                 <p>
197                   101
198                 </p>
199               </td>
200 <td>
201                 <p>
202                   The character used to start a sub-expression.
203                 </p>
204               </td>
205 <td>
206                 <p>
207                   "("
208                 </p>
209               </td>
210 </tr>
211 <tr>
212 <td>
213                 <p>
214                   102
215                 </p>
216               </td>
217 <td>
218                 <p>
219                   The character used to end a sub-expression declaration.
220                 </p>
221               </td>
222 <td>
223                 <p>
224                   ")"
225                 </p>
226               </td>
227 </tr>
228 <tr>
229 <td>
230                 <p>
231                   103
232                 </p>
233               </td>
234 <td>
235                 <p>
236                   The character used to denote an end of line assertion.
237                 </p>
238               </td>
239 <td>
240                 <p>
241                   "$"
242                 </p>
243               </td>
244 </tr>
245 <tr>
246 <td>
247                 <p>
248                   104
249                 </p>
250               </td>
251 <td>
252                 <p>
253                   The character used to denote the start of line assertion.
254                 </p>
255               </td>
256 <td>
257                 <p>
258                   "^"
259                 </p>
260               </td>
261 </tr>
262 <tr>
263 <td>
264                 <p>
265                   105
266                 </p>
267               </td>
268 <td>
269                 <p>
270                   The character used to denote the "match any character expression".
271                 </p>
272               </td>
273 <td>
274                 <p>
275                   "."
276                 </p>
277               </td>
278 </tr>
279 <tr>
280 <td>
281                 <p>
282                   106
283                 </p>
284               </td>
285 <td>
286                 <p>
287                   The match zero or more times repetition operator.
288                 </p>
289               </td>
290 <td>
291                 <p>
292                   "*"
293                 </p>
294               </td>
295 </tr>
296 <tr>
297 <td>
298                 <p>
299                   107
300                 </p>
301               </td>
302 <td>
303                 <p>
304                   The match one or more repetition operator.
305                 </p>
306               </td>
307 <td>
308                 <p>
309                   "+"
310                 </p>
311               </td>
312 </tr>
313 <tr>
314 <td>
315                 <p>
316                   108
317                 </p>
318               </td>
319 <td>
320                 <p>
321                   The match zero or one repetition operator.
322                 </p>
323               </td>
324 <td>
325                 <p>
326                   "?"
327                 </p>
328               </td>
329 </tr>
330 <tr>
331 <td>
332                 <p>
333                   109
334                 </p>
335               </td>
336 <td>
337                 <p>
338                   The character set opening character.
339                 </p>
340               </td>
341 <td>
342                 <p>
343                   "["
344                 </p>
345               </td>
346 </tr>
347 <tr>
348 <td>
349                 <p>
350                   110
351                 </p>
352               </td>
353 <td>
354                 <p>
355                   The character set closing character.
356                 </p>
357               </td>
358 <td>
359                 <p>
360                   "]"
361                 </p>
362               </td>
363 </tr>
364 <tr>
365 <td>
366                 <p>
367                   111
368                 </p>
369               </td>
370 <td>
371                 <p>
372                   The alternation operator.
373                 </p>
374               </td>
375 <td>
376                 <p>
377                   "|"
378                 </p>
379               </td>
380 </tr>
381 <tr>
382 <td>
383                 <p>
384                   112
385                 </p>
386               </td>
387 <td>
388                 <p>
389                   The escape character.
390                 </p>
391               </td>
392 <td>
393                 <p>
394                   "\"
395                 </p>
396               </td>
397 </tr>
398 <tr>
399 <td>
400                 <p>
401                   113
402                 </p>
403               </td>
404 <td>
405                 <p>
406                   The hash character (not currently used).
407                 </p>
408               </td>
409 <td>
410                 <p>
411                   "#"
412                 </p>
413               </td>
414 </tr>
415 <tr>
416 <td>
417                 <p>
418                   114
419                 </p>
420               </td>
421 <td>
422                 <p>
423                   The range operator.
424                 </p>
425               </td>
426 <td>
427                 <p>
428                   "-"
429                 </p>
430               </td>
431 </tr>
432 <tr>
433 <td>
434                 <p>
435                   115
436                 </p>
437               </td>
438 <td>
439                 <p>
440                   The repetition operator opening character.
441                 </p>
442               </td>
443 <td>
444                 <p>
445                   "{"
446                 </p>
447               </td>
448 </tr>
449 <tr>
450 <td>
451                 <p>
452                   116
453                 </p>
454               </td>
455 <td>
456                 <p>
457                   The repetition operator closing character.
458                 </p>
459               </td>
460 <td>
461                 <p>
462                   "}"
463                 </p>
464               </td>
465 </tr>
466 <tr>
467 <td>
468                 <p>
469                   117
470                 </p>
471               </td>
472 <td>
473                 <p>
474                   The digit characters.
475                 </p>
476               </td>
477 <td>
478                 <p>
479                   "0123456789"
480                 </p>
481               </td>
482 </tr>
483 <tr>
484 <td>
485                 <p>
486                   118
487                 </p>
488               </td>
489 <td>
490                 <p>
491                   The character which when preceded by an escape character represents
492                   the word boundary assertion.
493                 </p>
494               </td>
495 <td>
496                 <p>
497                   "b"
498                 </p>
499               </td>
500 </tr>
501 <tr>
502 <td>
503                 <p>
504                   119
505                 </p>
506               </td>
507 <td>
508                 <p>
509                   The character which when preceded by an escape character represents
510                   the non-word boundary assertion.
511                 </p>
512               </td>
513 <td>
514                 <p>
515                   "B"
516                 </p>
517               </td>
518 </tr>
519 <tr>
520 <td>
521                 <p>
522                   120
523                 </p>
524               </td>
525 <td>
526                 <p>
527                   The character which when preceded by an escape character represents
528                   the word-start boundary assertion.
529                 </p>
530               </td>
531 <td>
532                 <p>
533                   "&lt;"
534                 </p>
535               </td>
536 </tr>
537 <tr>
538 <td>
539                 <p>
540                   121
541                 </p>
542               </td>
543 <td>
544                 <p>
545                   The character which when preceded by an escape character represents
546                   the word-end boundary assertion.
547                 </p>
548               </td>
549 <td>
550                 <p>
551                   "&gt;"
552                 </p>
553               </td>
554 </tr>
555 <tr>
556 <td>
557                 <p>
558                   122
559                 </p>
560               </td>
561 <td>
562                 <p>
563                   The character which when preceded by an escape character represents
564                   any word character.
565                 </p>
566               </td>
567 <td>
568                 <p>
569                   "w"
570                 </p>
571               </td>
572 </tr>
573 <tr>
574 <td>
575                 <p>
576                   123
577                 </p>
578               </td>
579 <td>
580                 <p>
581                   The character which when preceded by an escape character represents
582                   a non-word character.
583                 </p>
584               </td>
585 <td>
586                 <p>
587                   "W"
588                 </p>
589               </td>
590 </tr>
591 <tr>
592 <td>
593                 <p>
594                   124
595                 </p>
596               </td>
597 <td>
598                 <p>
599                   The character which when preceded by an escape character represents
600                   a start of buffer assertion.
601                 </p>
602               </td>
603 <td>
604                 <p>
605                   "`A"
606                 </p>
607               </td>
608 </tr>
609 <tr>
610 <td>
611                 <p>
612                   125
613                 </p>
614               </td>
615 <td>
616                 <p>
617                   The character which when preceded by an escape character represents
618                   an end of buffer assertion.
619                 </p>
620               </td>
621 <td>
622                 <p>
623                   "'z"
624                 </p>
625               </td>
626 </tr>
627 <tr>
628 <td>
629                 <p>
630                   126
631                 </p>
632               </td>
633 <td>
634                 <p>
635                   The newline character.
636                 </p>
637               </td>
638 <td>
639                 <p>
640                   "\n"
641                 </p>
642               </td>
643 </tr>
644 <tr>
645 <td>
646                 <p>
647                   127
648                 </p>
649               </td>
650 <td>
651                 <p>
652                   The comma separator.
653                 </p>
654               </td>
655 <td>
656                 <p>
657                   ","
658                 </p>
659               </td>
660 </tr>
661 <tr>
662 <td>
663                 <p>
664                   128
665                 </p>
666               </td>
667 <td>
668                 <p>
669                   The character which when preceded by an escape character represents
670                   the bell character.
671                 </p>
672               </td>
673 <td>
674                 <p>
675                   "a"
676                 </p>
677               </td>
678 </tr>
679 <tr>
680 <td>
681                 <p>
682                   129
683                 </p>
684               </td>
685 <td>
686                 <p>
687                   The character which when preceded by an escape character represents
688                   the form feed character.
689                 </p>
690               </td>
691 <td>
692                 <p>
693                   "f"
694                 </p>
695               </td>
696 </tr>
697 <tr>
698 <td>
699                 <p>
700                   130
701                 </p>
702               </td>
703 <td>
704                 <p>
705                   The character which when preceded by an escape character represents
706                   the newline character.
707                 </p>
708               </td>
709 <td>
710                 <p>
711                   "n"
712                 </p>
713               </td>
714 </tr>
715 <tr>
716 <td>
717                 <p>
718                   131
719                 </p>
720               </td>
721 <td>
722                 <p>
723                   The character which when preceded by an escape character represents
724                   the carriage return character.
725                 </p>
726               </td>
727 <td>
728                 <p>
729                   "r"
730                 </p>
731               </td>
732 </tr>
733 <tr>
734 <td>
735                 <p>
736                   132
737                 </p>
738               </td>
739 <td>
740                 <p>
741                   The character which when preceded by an escape character represents
742                   the tab character.
743                 </p>
744               </td>
745 <td>
746                 <p>
747                   "t"
748                 </p>
749               </td>
750 </tr>
751 <tr>
752 <td>
753                 <p>
754                   133
755                 </p>
756               </td>
757 <td>
758                 <p>
759                   The character which when preceded by an escape character represents
760                   the vertical tab character.
761                 </p>
762               </td>
763 <td>
764                 <p>
765                   "v"
766                 </p>
767               </td>
768 </tr>
769 <tr>
770 <td>
771                 <p>
772                   134
773                 </p>
774               </td>
775 <td>
776                 <p>
777                   The character which when preceded by an escape character represents
778                   the start of a hexadecimal character constant.
779                 </p>
780               </td>
781 <td>
782                 <p>
783                   "x"
784                 </p>
785               </td>
786 </tr>
787 <tr>
788 <td>
789                 <p>
790                   135
791                 </p>
792               </td>
793 <td>
794                 <p>
795                   The character which when preceded by an escape character represents
796                   the start of an ASCII escape character.
797                 </p>
798               </td>
799 <td>
800                 <p>
801                   "c"
802                 </p>
803               </td>
804 </tr>
805 <tr>
806 <td>
807                 <p>
808                   136
809                 </p>
810               </td>
811 <td>
812                 <p>
813                   The colon character.
814                 </p>
815               </td>
816 <td>
817                 <p>
818                   ":"
819                 </p>
820               </td>
821 </tr>
822 <tr>
823 <td>
824                 <p>
825                   137
826                 </p>
827               </td>
828 <td>
829                 <p>
830                   The equals character.
831                 </p>
832               </td>
833 <td>
834                 <p>
835                   "="
836                 </p>
837               </td>
838 </tr>
839 <tr>
840 <td>
841                 <p>
842                   138
843                 </p>
844               </td>
845 <td>
846                 <p>
847                   The character which when preceded by an escape character represents
848                   the ASCII escape character.
849                 </p>
850               </td>
851 <td>
852                 <p>
853                   "e"
854                 </p>
855               </td>
856 </tr>
857 <tr>
858 <td>
859                 <p>
860                   139
861                 </p>
862               </td>
863 <td>
864                 <p>
865                   The character which when preceded by an escape character represents
866                   any lower case character.
867                 </p>
868               </td>
869 <td>
870                 <p>
871                   "l"
872                 </p>
873               </td>
874 </tr>
875 <tr>
876 <td>
877                 <p>
878                   140
879                 </p>
880               </td>
881 <td>
882                 <p>
883                   The character which when preceded by an escape character represents
884                   any non-lower case character.
885                 </p>
886               </td>
887 <td>
888                 <p>
889                   "L"
890                 </p>
891               </td>
892 </tr>
893 <tr>
894 <td>
895                 <p>
896                   141
897                 </p>
898               </td>
899 <td>
900                 <p>
901                   The character which when preceded by an escape character represents
902                   any upper case character.
903                 </p>
904               </td>
905 <td>
906                 <p>
907                   "u"
908                 </p>
909               </td>
910 </tr>
911 <tr>
912 <td>
913                 <p>
914                   142
915                 </p>
916               </td>
917 <td>
918                 <p>
919                   The character which when preceded by an escape character represents
920                   any non-upper case character.
921                 </p>
922               </td>
923 <td>
924                 <p>
925                   "U"
926                 </p>
927               </td>
928 </tr>
929 <tr>
930 <td>
931                 <p>
932                   143
933                 </p>
934               </td>
935 <td>
936                 <p>
937                   The character which when preceded by an escape character represents
938                   any space character.
939                 </p>
940               </td>
941 <td>
942                 <p>
943                   "s"
944                 </p>
945               </td>
946 </tr>
947 <tr>
948 <td>
949                 <p>
950                   144
951                 </p>
952               </td>
953 <td>
954                 <p>
955                   The character which when preceded by an escape character represents
956                   any non-space character.
957                 </p>
958               </td>
959 <td>
960                 <p>
961                   "S"
962                 </p>
963               </td>
964 </tr>
965 <tr>
966 <td>
967                 <p>
968                   145
969                 </p>
970               </td>
971 <td>
972                 <p>
973                   The character which when preceded by an escape character represents
974                   any digit character.
975                 </p>
976               </td>
977 <td>
978                 <p>
979                   "d"
980                 </p>
981               </td>
982 </tr>
983 <tr>
984 <td>
985                 <p>
986                   146
987                 </p>
988               </td>
989 <td>
990                 <p>
991                   The character which when preceded by an escape character represents
992                   any non-digit character.
993                 </p>
994               </td>
995 <td>
996                 <p>
997                   "D"
998                 </p>
999               </td>
1000 </tr>
1001 <tr>
1002 <td>
1003                 <p>
1004                   147
1005                 </p>
1006               </td>
1007 <td>
1008                 <p>
1009                   The character which when preceded by an escape character represents
1010                   the end quote operator.
1011                 </p>
1012               </td>
1013 <td>
1014                 <p>
1015                   "E"
1016                 </p>
1017               </td>
1018 </tr>
1019 <tr>
1020 <td>
1021                 <p>
1022                   148
1023                 </p>
1024               </td>
1025 <td>
1026                 <p>
1027                   The character which when preceded by an escape character represents
1028                   the start quote operator.
1029                 </p>
1030               </td>
1031 <td>
1032                 <p>
1033                   "Q"
1034                 </p>
1035               </td>
1036 </tr>
1037 <tr>
1038 <td>
1039                 <p>
1040                   149
1041                 </p>
1042               </td>
1043 <td>
1044                 <p>
1045                   The character which when preceded by an escape character represents
1046                   a Unicode combining character sequence.
1047                 </p>
1048               </td>
1049 <td>
1050                 <p>
1051                   "X"
1052                 </p>
1053               </td>
1054 </tr>
1055 <tr>
1056 <td>
1057                 <p>
1058                   150
1059                 </p>
1060               </td>
1061 <td>
1062                 <p>
1063                   The character which when preceded by an escape character represents
1064                   any single character.
1065                 </p>
1066               </td>
1067 <td>
1068                 <p>
1069                   "C"
1070                 </p>
1071               </td>
1072 </tr>
1073 <tr>
1074 <td>
1075                 <p>
1076                   151
1077                 </p>
1078               </td>
1079 <td>
1080                 <p>
1081                   The character which when preceded by an escape character represents
1082                   end of buffer operator.
1083                 </p>
1084               </td>
1085 <td>
1086                 <p>
1087                   "Z"
1088                 </p>
1089               </td>
1090 </tr>
1091 <tr>
1092 <td>
1093                 <p>
1094                   152
1095                 </p>
1096               </td>
1097 <td>
1098                 <p>
1099                   The character which when preceded by an escape character represents
1100                   the continuation assertion.
1101                 </p>
1102               </td>
1103 <td>
1104                 <p>
1105                   "G"
1106                 </p>
1107               </td>
1108 </tr>
1109 <tr>
1110 <td>
1111                 <p>
1112                   153
1113                 </p>
1114               </td>
1115 <td>
1116                 <p>
1117                   The character which when preceeded by (? indicates a zero width
1118                   negated forward lookahead assert.
1119                 </p>
1120               </td>
1121 <td>
1122                 <p>
1123                   !
1124                 </p>
1125               </td>
1126 </tr>
1127 </tbody>
1128 </table></div>
1129 <p>
1130         Custom error messages are loaded as follows:
1131       </p>
1132 <div class="informaltable"><table class="table">
1133 <colgroup>
1134 <col>
1135 <col>
1136 <col>
1137 </colgroup>
1138 <thead><tr>
1139 <th>
1140                 <p>
1141                   Message ID
1142                 </p>
1143               </th>
1144 <th>
1145                 <p>
1146                   Error message ID
1147                 </p>
1148               </th>
1149 <th>
1150                 <p>
1151                   Default string
1152                 </p>
1153               </th>
1154 </tr></thead>
1155 <tbody>
1156 <tr>
1157 <td>
1158                 <p>
1159                   201
1160                 </p>
1161               </td>
1162 <td>
1163                 <p>
1164                   REG_NOMATCH
1165                 </p>
1166               </td>
1167 <td>
1168                 <p>
1169                   "No match"
1170                 </p>
1171               </td>
1172 </tr>
1173 <tr>
1174 <td>
1175                 <p>
1176                   202
1177                 </p>
1178               </td>
1179 <td>
1180                 <p>
1181                   REG_BADPAT
1182                 </p>
1183               </td>
1184 <td>
1185                 <p>
1186                   "Invalid regular expression"
1187                 </p>
1188               </td>
1189 </tr>
1190 <tr>
1191 <td>
1192                 <p>
1193                   203
1194                 </p>
1195               </td>
1196 <td>
1197                 <p>
1198                   REG_ECOLLATE
1199                 </p>
1200               </td>
1201 <td>
1202                 <p>
1203                   "Invalid collation character"
1204                 </p>
1205               </td>
1206 </tr>
1207 <tr>
1208 <td>
1209                 <p>
1210                   204
1211                 </p>
1212               </td>
1213 <td>
1214                 <p>
1215                   REG_ECTYPE
1216                 </p>
1217               </td>
1218 <td>
1219                 <p>
1220                   "Invalid character class name"
1221                 </p>
1222               </td>
1223 </tr>
1224 <tr>
1225 <td>
1226                 <p>
1227                   205
1228                 </p>
1229               </td>
1230 <td>
1231                 <p>
1232                   REG_EESCAPE
1233                 </p>
1234               </td>
1235 <td>
1236                 <p>
1237                   "Trailing backslash"
1238                 </p>
1239               </td>
1240 </tr>
1241 <tr>
1242 <td>
1243                 <p>
1244                   206
1245                 </p>
1246               </td>
1247 <td>
1248                 <p>
1249                   REG_ESUBREG
1250                 </p>
1251               </td>
1252 <td>
1253                 <p>
1254                   "Invalid back reference"
1255                 </p>
1256               </td>
1257 </tr>
1258 <tr>
1259 <td>
1260                 <p>
1261                   207
1262                 </p>
1263               </td>
1264 <td>
1265                 <p>
1266                   REG_EBRACK
1267                 </p>
1268               </td>
1269 <td>
1270                 <p>
1271                   "Unmatched [ or <code class="literal">" </code>
1272                 </p>
1273               </td>
1274 <td>
1275                 <p>
1276                   [208
1277                 </p>
1278               </td>
1279 <td>
1280                 <p>
1281                   REG_EPAREN
1282                 </p>
1283               </td>
1284 <td>
1285                 <p>
1286                   "Unmatched ( or \("
1287                 </p>
1288               </td>
1289 </tr>
1290 <tr>
1291 <td>
1292                 <p>
1293                   209
1294                 </p>
1295               </td>
1296 <td>
1297                 <p>
1298                   REG_EBRACE
1299                 </p>
1300               </td>
1301 <td>
1302                 <p>
1303                   "Unmatched \{"
1304                 </p>
1305               </td>
1306 </tr>
1307 <tr>
1308 <td>
1309                 <p>
1310                   210
1311                 </p>
1312               </td>
1313 <td>
1314                 <p>
1315                   REG_BADBR
1316                 </p>
1317               </td>
1318 <td>
1319                 <p>
1320                   "Invalid content of \{\}"
1321                 </p>
1322               </td>
1323 </tr>
1324 <tr>
1325 <td>
1326                 <p>
1327                   211
1328                 </p>
1329               </td>
1330 <td>
1331                 <p>
1332                   REG_ERANGE
1333                 </p>
1334               </td>
1335 <td>
1336                 <p>
1337                   "Invalid range end"
1338                 </p>
1339               </td>
1340 </tr>
1341 <tr>
1342 <td>
1343                 <p>
1344                   212
1345                 </p>
1346               </td>
1347 <td>
1348                 <p>
1349                   REG_ESPACE
1350                 </p>
1351               </td>
1352 <td>
1353                 <p>
1354                   "Memory exhausted"
1355                 </p>
1356               </td>
1357 </tr>
1358 <tr>
1359 <td>
1360                 <p>
1361                   213
1362                 </p>
1363               </td>
1364 <td>
1365                 <p>
1366                   REG_BADRPT
1367                 </p>
1368               </td>
1369 <td>
1370                 <p>
1371                   "Invalid preceding regular expression"
1372                 </p>
1373               </td>
1374 </tr>
1375 <tr>
1376 <td>
1377                 <p>
1378                   214
1379                 </p>
1380               </td>
1381 <td>
1382                 <p>
1383                   REG_EEND
1384                 </p>
1385               </td>
1386 <td>
1387                 <p>
1388                   "Premature end of regular expression"
1389                 </p>
1390               </td>
1391 </tr>
1392 <tr>
1393 <td>
1394                 <p>
1395                   215
1396                 </p>
1397               </td>
1398 <td>
1399                 <p>
1400                   REG_ESIZE
1401                 </p>
1402               </td>
1403 <td>
1404                 <p>
1405                   "Regular expression too big"
1406                 </p>
1407               </td>
1408 </tr>
1409 <tr>
1410 <td>
1411                 <p>
1412                   216
1413                 </p>
1414               </td>
1415 <td>
1416                 <p>
1417                   REG_ERPAREN
1418                 </p>
1419               </td>
1420 <td>
1421                 <p>
1422                   "Unmatched ) or \)"
1423                 </p>
1424               </td>
1425 </tr>
1426 <tr>
1427 <td>
1428                 <p>
1429                   217
1430                 </p>
1431               </td>
1432 <td>
1433                 <p>
1434                   REG_EMPTY
1435                 </p>
1436               </td>
1437 <td>
1438                 <p>
1439                   "Empty expression"
1440                 </p>
1441               </td>
1442 </tr>
1443 <tr>
1444 <td>
1445                 <p>
1446                   218
1447                 </p>
1448               </td>
1449 <td>
1450                 <p>
1451                   REG_E_UNKNOWN
1452                 </p>
1453               </td>
1454 <td>
1455                 <p>
1456                   "Unknown error"
1457                 </p>
1458               </td>
1459 </tr>
1460 </tbody>
1461 </table></div>
1462 <p>
1463         Custom character class names are loaded as followed:
1464       </p>
1465 <div class="informaltable"><table class="table">
1466 <colgroup>
1467 <col>
1468 <col>
1469 <col>
1470 </colgroup>
1471 <thead><tr>
1472 <th>
1473                 <p>
1474                   Message ID
1475                 </p>
1476               </th>
1477 <th>
1478                 <p>
1479                   Description
1480                 </p>
1481               </th>
1482 <th>
1483                 <p>
1484                   Equivalent default class name
1485                 </p>
1486               </th>
1487 </tr></thead>
1488 <tbody>
1489 <tr>
1490 <td>
1491                 <p>
1492                   300
1493                 </p>
1494               </td>
1495 <td>
1496                 <p>
1497                   The character class name for alphanumeric characters.
1498                 </p>
1499               </td>
1500 <td>
1501                 <p>
1502                   "alnum"
1503                 </p>
1504               </td>
1505 </tr>
1506 <tr>
1507 <td>
1508                 <p>
1509                   301
1510                 </p>
1511               </td>
1512 <td>
1513                 <p>
1514                   The character class name for alphabetic characters.
1515                 </p>
1516               </td>
1517 <td>
1518                 <p>
1519                   "alpha"
1520                 </p>
1521               </td>
1522 </tr>
1523 <tr>
1524 <td>
1525                 <p>
1526                   302
1527                 </p>
1528               </td>
1529 <td>
1530                 <p>
1531                   The character class name for control characters.
1532                 </p>
1533               </td>
1534 <td>
1535                 <p>
1536                   "cntrl"
1537                 </p>
1538               </td>
1539 </tr>
1540 <tr>
1541 <td>
1542                 <p>
1543                   303
1544                 </p>
1545               </td>
1546 <td>
1547                 <p>
1548                   The character class name for digit characters.
1549                 </p>
1550               </td>
1551 <td>
1552                 <p>
1553                   "digit"
1554                 </p>
1555               </td>
1556 </tr>
1557 <tr>
1558 <td>
1559                 <p>
1560                   304
1561                 </p>
1562               </td>
1563 <td>
1564                 <p>
1565                   The character class name for graphics characters.
1566                 </p>
1567               </td>
1568 <td>
1569                 <p>
1570                   "graph"
1571                 </p>
1572               </td>
1573 </tr>
1574 <tr>
1575 <td>
1576                 <p>
1577                   305
1578                 </p>
1579               </td>
1580 <td>
1581                 <p>
1582                   The character class name for lower case characters.
1583                 </p>
1584               </td>
1585 <td>
1586                 <p>
1587                   "lower"
1588                 </p>
1589               </td>
1590 </tr>
1591 <tr>
1592 <td>
1593                 <p>
1594                   306
1595                 </p>
1596               </td>
1597 <td>
1598                 <p>
1599                   The character class name for printable characters.
1600                 </p>
1601               </td>
1602 <td>
1603                 <p>
1604                   "print"
1605                 </p>
1606               </td>
1607 </tr>
1608 <tr>
1609 <td>
1610                 <p>
1611                   307
1612                 </p>
1613               </td>
1614 <td>
1615                 <p>
1616                   The character class name for punctuation characters.
1617                 </p>
1618               </td>
1619 <td>
1620                 <p>
1621                   "punct"
1622                 </p>
1623               </td>
1624 </tr>
1625 <tr>
1626 <td>
1627                 <p>
1628                   308
1629                 </p>
1630               </td>
1631 <td>
1632                 <p>
1633                   The character class name for space characters.
1634                 </p>
1635               </td>
1636 <td>
1637                 <p>
1638                   "space"
1639                 </p>
1640               </td>
1641 </tr>
1642 <tr>
1643 <td>
1644                 <p>
1645                   309
1646                 </p>
1647               </td>
1648 <td>
1649                 <p>
1650                   The character class name for upper case characters.
1651                 </p>
1652               </td>
1653 <td>
1654                 <p>
1655                   "upper"
1656                 </p>
1657               </td>
1658 </tr>
1659 <tr>
1660 <td>
1661                 <p>
1662                   310
1663                 </p>
1664               </td>
1665 <td>
1666                 <p>
1667                   The character class name for hexadecimal characters.
1668                 </p>
1669               </td>
1670 <td>
1671                 <p>
1672                   "xdigit"
1673                 </p>
1674               </td>
1675 </tr>
1676 <tr>
1677 <td>
1678                 <p>
1679                   311
1680                 </p>
1681               </td>
1682 <td>
1683                 <p>
1684                   The character class name for blank characters.
1685                 </p>
1686               </td>
1687 <td>
1688                 <p>
1689                   "blank"
1690                 </p>
1691               </td>
1692 </tr>
1693 <tr>
1694 <td>
1695                 <p>
1696                   312
1697                 </p>
1698               </td>
1699 <td>
1700                 <p>
1701                   The character class name for word characters.
1702                 </p>
1703               </td>
1704 <td>
1705                 <p>
1706                   "word"
1707                 </p>
1708               </td>
1709 </tr>
1710 <tr>
1711 <td>
1712                 <p>
1713                   313
1714                 </p>
1715               </td>
1716 <td>
1717                 <p>
1718                   The character class name for Unicode characters.
1719                 </p>
1720               </td>
1721 <td>
1722                 <p>
1723                   "unicode"
1724                 </p>
1725               </td>
1726 </tr>
1727 </tbody>
1728 </table></div>
1729 <p>
1730         Finally, custom collating element names are loaded starting from message
1731         id 400, and terminating when the first load thereafter fails. Each message
1732         looks something like: "tagname string" where tagname is the name
1733         used inside [[.tagname.]] and string is the actual text of the collating
1734         element. Note that the value of collating element [[.zero.]] is used for
1735         the conversion of strings to numbers - if you replace this with another value
1736         then that will be used for string parsing - for example use the Unicode character
1737         0x0660 for [[.zero.]] if you want to use Unicode Arabic-Indic digits in your
1738         regular expressions in place of Latin digits.
1739       </p>
1740 <p>
1741         Note that the POSIX defined names for character classes and collating elements
1742         are always available - even if custom names are defined, in contrast, custom
1743         error messages, and custom syntax messages replace the default ones.
1744       </p>
1745 </div>
1746 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
1747 <td align="left"></td>
1748 <td align="right"><div class="copyright-footer">Copyright &#169; 1998-2010 John Maddock<p>
1749         Distributed under the Boost Software License, Version 1.0. (See accompanying
1750         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>)
1751       </p>
1752 </div></td>
1753 </tr></table>
1754 <hr>
1755 <div class="spirit-nav">
1756 <a accesskey="p" href="headers.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background_information.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="thread_safety.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
1757 </div>
1758 </body>
1759 </html>