• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
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.79.1">
7<link rel="home" href="../../index.html" title="Boost.Regex 5.1.4">
8<link rel="up" href="../background.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.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.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.locale.h0"></a>
62        <span class="phrase"><a name="boost_regex.background.locale.win32_localization_model"></a></span><a class="link" href="locale.html#boost_regex.background.locale.win32_localization_model">Win32 localization
63        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.locale.h1"></a>
94        <span class="phrase"><a name="boost_regex.background.locale.c_localization_model"></a></span><a class="link" href="locale.html#boost_regex.background.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.locale.h2"></a>
118        <span class="phrase"><a name="boost_regex.background.locale.c_localization_model0"></a></span><a class="link" href="locale.html#boost_regex.background.locale.c_localization_model0">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.locale.h3"></a>
155        <span class="phrase"><a name="boost_regex.background.locale.providing_a_message_catalogue"></a></span><a class="link" href="locale.html#boost_regex.background.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 preceded 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 [^"
1272                </p>
1273              </td>
1274</tr>
1275<tr>
1276<td>
1277                <p>
1278                  208
1279                </p>
1280              </td>
1281<td>
1282                <p>
1283                  REG_EPAREN
1284                </p>
1285              </td>
1286<td>
1287                <p>
1288                  "Unmatched ( or \("
1289                </p>
1290              </td>
1291</tr>
1292<tr>
1293<td>
1294                <p>
1295                  209
1296                </p>
1297              </td>
1298<td>
1299                <p>
1300                  REG_EBRACE
1301                </p>
1302              </td>
1303<td>
1304                <p>
1305                  "Unmatched \{"
1306                </p>
1307              </td>
1308</tr>
1309<tr>
1310<td>
1311                <p>
1312                  210
1313                </p>
1314              </td>
1315<td>
1316                <p>
1317                  REG_BADBR
1318                </p>
1319              </td>
1320<td>
1321                <p>
1322                  "Invalid content of \{\}"
1323                </p>
1324              </td>
1325</tr>
1326<tr>
1327<td>
1328                <p>
1329                  211
1330                </p>
1331              </td>
1332<td>
1333                <p>
1334                  REG_ERANGE
1335                </p>
1336              </td>
1337<td>
1338                <p>
1339                  "Invalid range end"
1340                </p>
1341              </td>
1342</tr>
1343<tr>
1344<td>
1345                <p>
1346                  212
1347                </p>
1348              </td>
1349<td>
1350                <p>
1351                  REG_ESPACE
1352                </p>
1353              </td>
1354<td>
1355                <p>
1356                  "Memory exhausted"
1357                </p>
1358              </td>
1359</tr>
1360<tr>
1361<td>
1362                <p>
1363                  213
1364                </p>
1365              </td>
1366<td>
1367                <p>
1368                  REG_BADRPT
1369                </p>
1370              </td>
1371<td>
1372                <p>
1373                  "Invalid preceding regular expression"
1374                </p>
1375              </td>
1376</tr>
1377<tr>
1378<td>
1379                <p>
1380                  214
1381                </p>
1382              </td>
1383<td>
1384                <p>
1385                  REG_EEND
1386                </p>
1387              </td>
1388<td>
1389                <p>
1390                  "Premature end of regular expression"
1391                </p>
1392              </td>
1393</tr>
1394<tr>
1395<td>
1396                <p>
1397                  215
1398                </p>
1399              </td>
1400<td>
1401                <p>
1402                  REG_ESIZE
1403                </p>
1404              </td>
1405<td>
1406                <p>
1407                  "Regular expression too big"
1408                </p>
1409              </td>
1410</tr>
1411<tr>
1412<td>
1413                <p>
1414                  216
1415                </p>
1416              </td>
1417<td>
1418                <p>
1419                  REG_ERPAREN
1420                </p>
1421              </td>
1422<td>
1423                <p>
1424                  "Unmatched ) or \)"
1425                </p>
1426              </td>
1427</tr>
1428<tr>
1429<td>
1430                <p>
1431                  217
1432                </p>
1433              </td>
1434<td>
1435                <p>
1436                  REG_EMPTY
1437                </p>
1438              </td>
1439<td>
1440                <p>
1441                  "Empty expression"
1442                </p>
1443              </td>
1444</tr>
1445<tr>
1446<td>
1447                <p>
1448                  218
1449                </p>
1450              </td>
1451<td>
1452                <p>
1453                  REG_E_UNKNOWN
1454                </p>
1455              </td>
1456<td>
1457                <p>
1458                  "Unknown error"
1459                </p>
1460              </td>
1461</tr>
1462</tbody>
1463</table></div>
1464<p>
1465        Custom character class names are loaded as followed:
1466      </p>
1467<div class="informaltable"><table class="table">
1468<colgroup>
1469<col>
1470<col>
1471<col>
1472</colgroup>
1473<thead><tr>
1474<th>
1475                <p>
1476                  Message ID
1477                </p>
1478              </th>
1479<th>
1480                <p>
1481                  Description
1482                </p>
1483              </th>
1484<th>
1485                <p>
1486                  Equivalent default class name
1487                </p>
1488              </th>
1489</tr></thead>
1490<tbody>
1491<tr>
1492<td>
1493                <p>
1494                  300
1495                </p>
1496              </td>
1497<td>
1498                <p>
1499                  The character class name for alphanumeric characters.
1500                </p>
1501              </td>
1502<td>
1503                <p>
1504                  "alnum"
1505                </p>
1506              </td>
1507</tr>
1508<tr>
1509<td>
1510                <p>
1511                  301
1512                </p>
1513              </td>
1514<td>
1515                <p>
1516                  The character class name for alphabetic characters.
1517                </p>
1518              </td>
1519<td>
1520                <p>
1521                  "alpha"
1522                </p>
1523              </td>
1524</tr>
1525<tr>
1526<td>
1527                <p>
1528                  302
1529                </p>
1530              </td>
1531<td>
1532                <p>
1533                  The character class name for control characters.
1534                </p>
1535              </td>
1536<td>
1537                <p>
1538                  "cntrl"
1539                </p>
1540              </td>
1541</tr>
1542<tr>
1543<td>
1544                <p>
1545                  303
1546                </p>
1547              </td>
1548<td>
1549                <p>
1550                  The character class name for digit characters.
1551                </p>
1552              </td>
1553<td>
1554                <p>
1555                  "digit"
1556                </p>
1557              </td>
1558</tr>
1559<tr>
1560<td>
1561                <p>
1562                  304
1563                </p>
1564              </td>
1565<td>
1566                <p>
1567                  The character class name for graphics characters.
1568                </p>
1569              </td>
1570<td>
1571                <p>
1572                  "graph"
1573                </p>
1574              </td>
1575</tr>
1576<tr>
1577<td>
1578                <p>
1579                  305
1580                </p>
1581              </td>
1582<td>
1583                <p>
1584                  The character class name for lower case characters.
1585                </p>
1586              </td>
1587<td>
1588                <p>
1589                  "lower"
1590                </p>
1591              </td>
1592</tr>
1593<tr>
1594<td>
1595                <p>
1596                  306
1597                </p>
1598              </td>
1599<td>
1600                <p>
1601                  The character class name for printable characters.
1602                </p>
1603              </td>
1604<td>
1605                <p>
1606                  "print"
1607                </p>
1608              </td>
1609</tr>
1610<tr>
1611<td>
1612                <p>
1613                  307
1614                </p>
1615              </td>
1616<td>
1617                <p>
1618                  The character class name for punctuation characters.
1619                </p>
1620              </td>
1621<td>
1622                <p>
1623                  "punct"
1624                </p>
1625              </td>
1626</tr>
1627<tr>
1628<td>
1629                <p>
1630                  308
1631                </p>
1632              </td>
1633<td>
1634                <p>
1635                  The character class name for space characters.
1636                </p>
1637              </td>
1638<td>
1639                <p>
1640                  "space"
1641                </p>
1642              </td>
1643</tr>
1644<tr>
1645<td>
1646                <p>
1647                  309
1648                </p>
1649              </td>
1650<td>
1651                <p>
1652                  The character class name for upper case characters.
1653                </p>
1654              </td>
1655<td>
1656                <p>
1657                  "upper"
1658                </p>
1659              </td>
1660</tr>
1661<tr>
1662<td>
1663                <p>
1664                  310
1665                </p>
1666              </td>
1667<td>
1668                <p>
1669                  The character class name for hexadecimal characters.
1670                </p>
1671              </td>
1672<td>
1673                <p>
1674                  "xdigit"
1675                </p>
1676              </td>
1677</tr>
1678<tr>
1679<td>
1680                <p>
1681                  311
1682                </p>
1683              </td>
1684<td>
1685                <p>
1686                  The character class name for blank characters.
1687                </p>
1688              </td>
1689<td>
1690                <p>
1691                  "blank"
1692                </p>
1693              </td>
1694</tr>
1695<tr>
1696<td>
1697                <p>
1698                  312
1699                </p>
1700              </td>
1701<td>
1702                <p>
1703                  The character class name for word characters.
1704                </p>
1705              </td>
1706<td>
1707                <p>
1708                  "word"
1709                </p>
1710              </td>
1711</tr>
1712<tr>
1713<td>
1714                <p>
1715                  313
1716                </p>
1717              </td>
1718<td>
1719                <p>
1720                  The character class name for Unicode characters.
1721                </p>
1722              </td>
1723<td>
1724                <p>
1725                  "unicode"
1726                </p>
1727              </td>
1728</tr>
1729</tbody>
1730</table></div>
1731<p>
1732        Finally, custom collating element names are loaded starting from message
1733        id 400, and terminating when the first load thereafter fails. Each message
1734        looks something like: "tagname string" where tagname is the name
1735        used inside [[.tagname.]] and string is the actual text of the collating
1736        element. Note that the value of collating element [[.zero.]] is used for
1737        the conversion of strings to numbers - if you replace this with another value
1738        then that will be used for string parsing - for example use the Unicode character
1739        0x0660 for [[.zero.]] if you want to use Unicode Arabic-Indic digits in your
1740        regular expressions in place of Latin digits.
1741      </p>
1742<p>
1743        Note that the POSIX defined names for character classes and collating elements
1744        are always available - even if custom names are defined, in contrast, custom
1745        error messages, and custom syntax messages replace the default ones.
1746      </p>
1747</div>
1748<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
1749<td align="left"></td>
1750<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
1751        Distributed under the Boost Software License, Version 1.0. (See accompanying
1752        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>)
1753      </p>
1754</div></td>
1755</tr></table>
1756<hr>
1757<div class="spirit-nav">
1758<a accesskey="p" href="headers.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.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>
1759</div>
1760</body>
1761</html>
1762