3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Unicode regular expression types
</title>
5 <link rel=
"stylesheet" href=
"../../../../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.77.1">
7 <link rel=
"home" href=
"../../../../index.html" title=
"Boost.Regex 5.1.2">
8 <link rel=
"up" href=
"../icu.html" title=
"Working With Unicode and ICU String Types">
9 <link rel=
"prev" href=
"intro.html" title=
"Introduction to using Regex with ICU">
10 <link rel=
"next" href=
"unicode_algo.html" title=
"Unicode Regular Expression Algorithms">
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>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"intro.html"><img src=
"../../../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../icu.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=
"unicode_algo.html"><img src=
"../../../../../../../../doc/src/images/next.png" alt=
"Next"></a>
26 <div class=
"titlepage"><div><div><h5 class=
"title">
27 <a name=
"boost_regex.ref.non_std_strings.icu.unicode_types"></a><a class=
"link" href=
"unicode_types.html" title=
"Unicode regular expression types">Unicode
28 regular expression types
</a>
29 </h5></div></div></div>
31 Header
<code class=
"computeroutput"><span class=
"special"><</span><span class=
"identifier">boost
</span><span class=
"special">/
</span><span class=
"identifier">regex
</span><span class=
"special">/
</span><span class=
"identifier">icu
</span><span class=
"special">.
</span><span class=
"identifier">hpp
</span><span class=
"special">></span></code> provides a regular expression traits
32 class that handles UTF-
32 characters:
34 <pre class=
"programlisting"><span class=
"keyword">class
</span> <span class=
"identifier">icu_regex_traits
</span><span class=
"special">;
</span>
37 and a regular expression type based upon that:
39 <pre class=
"programlisting"><span class=
"keyword">typedef
</span> <span class=
"identifier">basic_regex
</span><span class=
"special"><</span><span class=
"identifier">UChar32
</span><span class=
"special">,
</span><span class=
"identifier">icu_regex_traits
</span><span class=
"special">></span> <span class=
"identifier">u32regex
</span><span class=
"special">;
</span>
42 The type
<code class=
"computeroutput"><span class=
"identifier">u32regex
</span></code> is
43 regular expression type to use for all Unicode regular expressions; internally
44 it uses UTF-
32 code points, but can be created from, and used to search,
45 either UTF-
8, or UTF-
16 encoded strings as well as UTF-
32 ones.
48 The constructors, and assign member functions of
<code class=
"computeroutput"><span class=
"identifier">u32regex
</span></code>,
49 require UTF-
32 encoded strings, but there are a series of overloaded
50 algorithms called
<code class=
"computeroutput"><span class=
"identifier">make_u32regex
</span></code>
51 which allow regular expressions to be created from UTF-
8, UTF-
16, or
52 UTF-
32 encoded strings:
54 <pre class=
"programlisting"><span class=
"keyword">template
</span> <span class=
"special"><</span><span class=
"keyword">class
</span> <span class=
"identifier">InputIterator
</span><span class=
"special">></span>
55 <span class=
"identifier">u32regex
</span> <span class=
"identifier">make_u32regex
</span><span class=
"special">(
</span><span class=
"identifier">InputIterator
</span> <span class=
"identifier">i
</span><span class=
"special">,
</span>
56 <span class=
"identifier">InputIterator
</span> <span class=
"identifier">j
</span><span class=
"special">,
</span>
57 <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">syntax_option_type
</span> <span class=
"identifier">opt
</span><span class=
"special">);
</span>
60 <span class=
"bold"><strong>Effects
</strong></span>: Creates a regular expression
61 object from the iterator sequence [i,j). The character encoding of the
62 sequence is determined based upon sizeof(*i):
1 implies UTF-
8,
2 implies
63 UTF-
16, and
4 implies UTF-
32.
65 <pre class=
"programlisting"><span class=
"identifier">u32regex
</span> <span class=
"identifier">make_u32regex
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"keyword">char
</span><span class=
"special">*
</span> <span class=
"identifier">p
</span><span class=
"special">,
</span>
66 <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">syntax_option_type
</span> <span class=
"identifier">opt
</span>
67 <span class=
"special">=
</span> <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">perl
</span><span class=
"special">);
</span>
70 <span class=
"bold"><strong>Effects
</strong></span>: Creates a regular expression
71 object from the Null-terminated UTF-
8 character sequence
<span class=
"emphasis"><em>p
</em></span>.
73 <pre class=
"programlisting"><span class=
"identifier">u32regex
</span> <span class=
"identifier">make_u32regex
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"keyword">unsigned
</span> <span class=
"keyword">char
</span><span class=
"special">*
</span> <span class=
"identifier">p
</span><span class=
"special">,
</span>
74 <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">syntax_option_type
</span> <span class=
"identifier">opt
</span>
75 <span class=
"special">=
</span> <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">perl
</span><span class=
"special">);
</span>
78 <span class=
"bold"><strong>Effects
</strong></span>: Creates a regular expression
79 object from the Null-terminated UTF-
8 character sequence p.
81 <pre class=
"programlisting"><span class=
"identifier">u32regex
</span> <span class=
"identifier">make_u32regex
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"keyword">wchar_t
</span><span class=
"special">*
</span> <span class=
"identifier">p
</span><span class=
"special">,
</span>
82 <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">syntax_option_type
</span> <span class=
"identifier">opt
</span>
83 <span class=
"special">=
</span> <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">perl
</span><span class=
"special">);
</span>
86 <span class=
"bold"><strong>Effects
</strong></span>: Creates a regular expression
87 object from the Null-terminated character sequence p. The character encoding
88 of the sequence is determined based upon sizeof(wchar_t):
1 implies UTF-
8,
89 2 implies UTF-
16, and
4 implies UTF-
32.
91 <pre class=
"programlisting"><span class=
"identifier">u32regex
</span> <span class=
"identifier">make_u32regex
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">UChar
</span><span class=
"special">*
</span> <span class=
"identifier">p
</span><span class=
"special">,
</span>
92 <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">syntax_option_type
</span> <span class=
"identifier">opt
</span>
93 <span class=
"special">=
</span> <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">perl
</span><span class=
"special">);
</span>
96 <span class=
"bold"><strong>Effects
</strong></span>: Creates a regular expression
97 object from the Null-terminated UTF-
16 character sequence p.
99 <pre class=
"programlisting"><span class=
"keyword">template
</span><span class=
"special"><</span><span class=
"keyword">class
</span> <span class=
"identifier">C
</span><span class=
"special">,
</span> <span class=
"keyword">class
</span> <span class=
"identifier">T
</span><span class=
"special">,
</span> <span class=
"keyword">class
</span> <span class=
"identifier">A
</span><span class=
"special">></span>
100 <span class=
"identifier">u32regex
</span> <span class=
"identifier">make_u32regex
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">std
</span><span class=
"special">::
</span><span class=
"identifier">basic_string
</span><span class=
"special"><</span><span class=
"identifier">C
</span><span class=
"special">,
</span> <span class=
"identifier">T
</span><span class=
"special">,
</span> <span class=
"identifier">A
</span><span class=
"special">>&</span> <span class=
"identifier">s
</span><span class=
"special">,
</span>
101 <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">syntax_option_type
</span> <span class=
"identifier">opt
</span>
102 <span class=
"special">=
</span> <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">perl
</span><span class=
"special">);
</span>
105 <span class=
"bold"><strong>Effects
</strong></span>: Creates a regular expression
106 object from the string s. The character encoding of the string is determined
107 based upon sizeof(C):
1 implies UTF-
8,
2 implies UTF-
16, and
4 implies
110 <pre class=
"programlisting"><span class=
"identifier">u32regex
</span> <span class=
"identifier">make_u32regex
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">UnicodeString
</span><span class=
"special">&</span> <span class=
"identifier">s
</span><span class=
"special">,
</span>
111 <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">syntax_option_type
</span> <span class=
"identifier">opt
</span>
112 <span class=
"special">=
</span> <span class=
"identifier">boost
</span><span class=
"special">::
</span><span class=
"identifier">regex_constants
</span><span class=
"special">::
</span><span class=
"identifier">perl
</span><span class=
"special">);
</span>
115 <span class=
"bold"><strong>Effects
</strong></span>: Creates a regular expression
116 object from the UTF-
16 encoding string s.
119 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
120 <td align=
"left"></td>
121 <td align=
"right"><div class=
"copyright-footer">Copyright
© 1998-
2013 John Maddock
<p>
122 Distributed under the Boost Software License, Version
1.0. (See accompanying
123 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>)
128 <div class=
"spirit-nav">
129 <a accesskey=
"p" href=
"intro.html"><img src=
"../../../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../icu.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=
"unicode_algo.html"><img src=
"../../../../../../../../doc/src/images/next.png" alt=
"Next"></a>