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 optimize = 0, // not really supported
91 basic = basic_syntax_group | collate | no_escape_in_lists,
92 extended = no_bk_refs | collate | no_perl_ex | no_escape_in_lists,
94 emacs = basic_syntax_group | collate | emacs_ex | bk_vbar,
95 awk = no_bk_refs | collate | no_perl_ex,
96 grep = basic | newline_alt,
97 egrep = extended | newline_alt,
104 typedef unsigned int flag_type;
112 restart_continue = 4,
114 restart_fixed_lit = 6,
120 // provide std lib proposal compatible constants:
122 namespace regex_constants{
127 no_except = ::boost::regbase::no_except,
128 failbit = ::boost::regbase::failbit,
129 literal = ::boost::regbase::literal,
130 icase = ::boost::regbase::icase,
131 nocollate = ::boost::regbase::nocollate,
132 collate = ::boost::regbase::collate,
133 nosubs = ::boost::regbase::nosubs,
134 optimize = ::boost::regbase::optimize,
135 bk_plus_qm = ::boost::regbase::bk_plus_qm,
136 bk_vbar = ::boost::regbase::bk_vbar,
137 no_intervals = ::boost::regbase::no_intervals,
138 no_char_classes = ::boost::regbase::no_char_classes,
139 no_escape_in_lists = ::boost::regbase::no_escape_in_lists,
140 no_mod_m = ::boost::regbase::no_mod_m,
141 mod_x = ::boost::regbase::mod_x,
142 mod_s = ::boost::regbase::mod_s,
143 no_mod_s = ::boost::regbase::no_mod_s,
145 basic = ::boost::regbase::basic,
146 extended = ::boost::regbase::extended,
147 normal = ::boost::regbase::normal,
148 emacs = ::boost::regbase::emacs,
149 awk = ::boost::regbase::awk,
150 grep = ::boost::regbase::grep,
151 egrep = ::boost::regbase::egrep,
158 typedef ::boost::regbase::flag_type syntax_option_type;
160 } // namespace regex_constants
165 #pragma warning(push)
166 #pragma warning(disable: 4103)
168 #ifdef BOOST_HAS_ABI_HEADERS
169 # include BOOST_ABI_SUFFIX