3 * Copyright (c) 1998-2002
6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
13 * LOCATION: see http://www.boost.org for most recent version.
15 * VERSION see <boost/version.hpp>
16 * DESCRIPTION: Declares class regbase.
19 #ifndef BOOST_REGEX_V4_REGBASE_HPP
20 #define BOOST_REGEX_V4_REGBASE_HPP
24 #pragma warning(disable: 4103)
26 #ifdef BOOST_HAS_ABI_HEADERS
27 # include BOOST_ABI_PREFIX
36 // handles error codes and flags
38 class BOOST_REGEX_DECL regbase
44 // Divide the flags up into logical groups:
45 // bits 0-7 indicate main synatx type.
46 // bits 8-15 indicate syntax subtype.
47 // bits 16-31 indicate options that are common to all
49 // In all cases the default is 0.
53 perl_syntax_group = 0, // default
54 basic_syntax_group = 1, // POSIX basic
55 literal = 2, // all characters are literals
56 main_option_type = literal | basic_syntax_group | perl_syntax_group, // everything!
58 // options specific to perl group:
60 no_bk_refs = 1 << 8, // \d not allowed
61 no_perl_ex = 1 << 9, // disable perl extensions
62 no_mod_m = 1 << 10, // disable Perl m modifier
63 mod_x = 1 << 11, // Perl x modifier
64 mod_s = 1 << 12, // force s modifier on (overrides match_not_dot_newline)
65 no_mod_s = 1 << 13, // force s modifier off (overrides match_not_dot_newline)
68 // options specific to basic group:
70 no_char_classes = 1 << 8, // [[:CLASS:]] not allowed
71 no_intervals = 1 << 9, // {x,y} not allowed
72 bk_plus_qm = 1 << 10, // uses \+ and \?
73 bk_vbar = 1 << 11, // use \| for alternatives
74 emacs_ex = 1 << 12, // enables emacs extensions
77 // options common to all groups:
79 no_escape_in_lists = 1 << 16, // '\' not special inside [...]
80 newline_alt = 1 << 17, // \n is the same as |
81 no_except = 1 << 18, // no exception on error
82 failbit = 1 << 19, // error flag
83 icase = 1 << 20, // characters are matched regardless of case
84 nocollate = 0, // don't use locale specific collation (deprecated)
85 collate = 1 << 21, // use locale specific collation
86 nosubs = 1 << 22, // don't mark sub-expressions
87 save_subexpression_location = 1 << 23, // save subexpression locations
88 no_empty_expressions = 1 << 24, // no empty expressions allowed
89 optimize = 0, // not really supported
93 basic = basic_syntax_group | collate | no_escape_in_lists,
94 extended = no_bk_refs | collate | no_perl_ex | no_escape_in_lists,
96 emacs = basic_syntax_group | collate | emacs_ex | bk_vbar,
97 awk = no_bk_refs | collate | no_perl_ex,
98 grep = basic | newline_alt,
99 egrep = extended | newline_alt,
106 typedef unsigned int flag_type;
114 restart_continue = 4,
116 restart_fixed_lit = 6,
122 // provide std lib proposal compatible constants:
124 namespace regex_constants{
129 no_except = ::boost::regbase::no_except,
130 failbit = ::boost::regbase::failbit,
131 literal = ::boost::regbase::literal,
132 icase = ::boost::regbase::icase,
133 nocollate = ::boost::regbase::nocollate,
134 collate = ::boost::regbase::collate,
135 nosubs = ::boost::regbase::nosubs,
136 optimize = ::boost::regbase::optimize,
137 bk_plus_qm = ::boost::regbase::bk_plus_qm,
138 bk_vbar = ::boost::regbase::bk_vbar,
139 no_intervals = ::boost::regbase::no_intervals,
140 no_char_classes = ::boost::regbase::no_char_classes,
141 no_escape_in_lists = ::boost::regbase::no_escape_in_lists,
142 no_mod_m = ::boost::regbase::no_mod_m,
143 mod_x = ::boost::regbase::mod_x,
144 mod_s = ::boost::regbase::mod_s,
145 no_mod_s = ::boost::regbase::no_mod_s,
146 save_subexpression_location = ::boost::regbase::save_subexpression_location,
147 no_empty_expressions = ::boost::regbase::no_empty_expressions,
149 basic = ::boost::regbase::basic,
150 extended = ::boost::regbase::extended,
151 normal = ::boost::regbase::normal,
152 emacs = ::boost::regbase::emacs,
153 awk = ::boost::regbase::awk,
154 grep = ::boost::regbase::grep,
155 egrep = ::boost::regbase::egrep,
162 typedef ::boost::regbase::flag_type syntax_option_type;
164 } // namespace regex_constants
169 #pragma warning(push)
170 #pragma warning(disable: 4103)
172 #ifdef BOOST_HAS_ABI_HEADERS
173 # include BOOST_ABI_SUFFIX