mirror of
https://github.com/boostorg/regex.git
synced 2025-07-02 15:20:58 +02:00
Compare commits
18 Commits
boost-1.23
...
boost-1.24
Author | SHA1 | Date | |
---|---|---|---|
6d65cfb7bb | |||
139a2f60fb | |||
a4912a834e | |||
014b66b2f4 | |||
b2ea26705d | |||
432f59cde7 | |||
846da064e0 | |||
88a6779e8b | |||
5749937f26 | |||
e1492c79ce | |||
a06c964cab | |||
77f76889f8 | |||
50c4d1e6ca | |||
7079ba0424 | |||
e7b8b5712d | |||
f5f309be54 | |||
890dc95e0d | |||
517d3e9256 |
2527
appendix.htm
2527
appendix.htm
File diff suppressed because it is too large
Load Diff
26
build/Jamfile
Normal file
26
build/Jamfile
Normal file
@ -0,0 +1,26 @@
|
||||
subproject libs/regex/build ;
|
||||
|
||||
SOURCES = c_regex_traits c_regex_traits_common cpp_regex_traits
|
||||
cregex fileiter posix_api regex regex_debug
|
||||
regex_synch w32_regex_traits wide_posix_api ;
|
||||
|
||||
lib libboost_regex$(SUFLIB) : ../src/$(SOURCES).cpp
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug release
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
|
||||
dll libboost_regex$(SUFDLL[1]) : ../src/$(SOURCES).cpp
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_BUILD_DLL=1
|
||||
:
|
||||
debug release
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
|
@ -196,7 +196,7 @@ ADDED: High level C++ class RegEx.
|
||||
|
||||
Version 111:
|
||||
BUG: Wouldn't compile directly on C++ Builder 4 when it was released
|
||||
(not really a bug - more an incompatability)
|
||||
(not really a bug - more an incompatibility)
|
||||
|
||||
FIXED: All bugs discovered prior to this version (below).
|
||||
|
||||
|
147
example/Jamfile
Normal file
147
example/Jamfile
Normal file
@ -0,0 +1,147 @@
|
||||
subproject libs/regex/example ;
|
||||
|
||||
|
||||
exe timer : timer/regex_timer.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe jgrep : jgrep/jgrep.cpp jgrep/main.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe credit_card_example : snippets/credit_card_example.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
|
||||
exe partial_regex_grep : snippets/partial_regex_grep.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe partial_regex_match : snippets/partial_regex_match.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_grep_example_1 : snippets/regex_grep_example_1.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_grep_example_2 : snippets/regex_grep_example_2.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_grep_example_3 : snippets/regex_grep_example_3.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_grep_example_4 : snippets/regex_grep_example_4.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_match_example : snippets/regex_match_example.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_merge_example : snippets/regex_merge_example.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_search_example : snippets/regex_search_example.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_split_example_1 : snippets/regex_split_example_1.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe regex_split_example_2 : snippets/regex_split_example_2.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
@ -4,7 +4,8 @@
|
||||
#
|
||||
|
||||
jgrep.exe: main.cpp jgrep.cpp jgrep.h
|
||||
cl -GX -GR /Oityb1 /GF /Gy -I..\..\..\..\ jgrep.cpp main.cpp /link /LIBPATH:..\..\build\vc6 user32.lib
|
||||
cl -GX -GR /Oityb1 /GF /Gy -I..\..\..\..\ jgrep.cpp main.cpp /link /LIBPATH:..\..\build\vc6
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -100,7 +100,7 @@ int main()
|
||||
std::deque<char> ds;
|
||||
boost::regex_t r;
|
||||
boost::scoped_array<boost::regmatch_t> matches;
|
||||
size_t nsubs;
|
||||
std::size_t nsubs;
|
||||
boost::timer t;
|
||||
double tim;
|
||||
bool result;
|
||||
@ -117,9 +117,9 @@ int main()
|
||||
std::copy(s1.begin(), s1.end(), string_out_iterator<std::wstring>(ws1));
|
||||
#endif
|
||||
try{
|
||||
ex.assign(s1.begin(), s1.end());
|
||||
ex.assign(s1);
|
||||
#ifndef BOOST_RE_NO_WCSTRING
|
||||
wex.assign(ws1.begin(), ws1.end());
|
||||
wex.assign(ws1);
|
||||
#endif
|
||||
}
|
||||
catch(std::exception& e)
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
CXX=cl
|
||||
CXXFLAGS=/Oityb1 /GF /Gy -GX -DSTRICT -I../../../../ -I./
|
||||
LIBS=/link /LIBPATH:..\..\build\vc6 kernel32.lib user32.lib
|
||||
LIBS=/link /LIBPATH:..\..\build\vc6
|
||||
EXE=.exe
|
||||
OBJ=.obj
|
||||
|
||||
@ -31,3 +31,4 @@ timer$(OBJ) : ../../../timer/timer.cpp $(LIBDEP)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
/* start with C compatability API */
|
||||
/* start with C compatibility API */
|
||||
|
||||
#ifndef BOOST_RE_REGEX_HPP
|
||||
#define BOOST_RE_REGEX_HPP
|
||||
@ -527,11 +527,11 @@ public:
|
||||
|
||||
template <class ST, class SA>
|
||||
explicit reg_expression(const std::basic_string<charT, ST, SA>& p, flag_type f = regbase::normal, const Allocator& a = Allocator())
|
||||
: data(a), pkmp(0) { set_expression(p, f | regbase::use_except); }
|
||||
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) { set_expression(p, f | regbase::use_except); }
|
||||
|
||||
template <class I>
|
||||
reg_expression(I first, I last, flag_type f = regbase::normal, const Allocator& al = Allocator())
|
||||
: data(al), pkmp(0)
|
||||
: data(al), pkmp(0), error_code_(REG_EMPTY), _expression(0)
|
||||
{
|
||||
size_type len = last-first;
|
||||
scoped_array<charT> a(new charT[len]);
|
||||
@ -637,7 +637,7 @@ public:
|
||||
bool BOOST_RE_CALL operator<(const reg_expression&)const;
|
||||
//
|
||||
// The following are deprecated as public interfaces
|
||||
// but are available for compatability with earlier versions.
|
||||
// but are available for compatibility with earlier versions.
|
||||
allocator_type BOOST_RE_CALL allocator()const;
|
||||
const charT* BOOST_RE_CALL expression()const { return (this->error_code() ? 0 : _expression); }
|
||||
unsigned int BOOST_RE_CALL set_expression(const charT* p, const charT* end, flag_type f = regbase::normal);
|
||||
@ -656,14 +656,14 @@ private:
|
||||
unsigned marks;
|
||||
int repeats;
|
||||
unsigned char* startmap;
|
||||
charT* _expression;
|
||||
unsigned _expression_len;
|
||||
unsigned int _leading_len;
|
||||
const charT* _leading_string;
|
||||
unsigned int _leading_string_len;
|
||||
re_detail::kmp_info<charT>* pkmp;
|
||||
traits_type traits_inst;
|
||||
unsigned error_code_;
|
||||
charT* _expression;
|
||||
traits_type traits_inst;
|
||||
|
||||
void BOOST_RE_CALL compile_maps();
|
||||
void BOOST_RE_CALL compile_map(re_detail::re_syntax_base* node, unsigned char* _map, unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal = 0)const;
|
||||
|
@ -91,34 +91,34 @@ inline bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::can_start(ch
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const Allocator& a)
|
||||
: regbase(), data(a), pkmp(0), error_code_(REG_EMPTY)
|
||||
: regbase(), data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
|
||||
{
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, flag_type f, const Allocator& a)
|
||||
: data(a), pkmp(0), error_code_(REG_EMPTY)
|
||||
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
|
||||
{
|
||||
set_expression(p, f | regbase::use_except);
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p1, const charT* p2, flag_type f, const Allocator& a)
|
||||
: data(a), pkmp(0), error_code_(REG_EMPTY)
|
||||
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
|
||||
{
|
||||
set_expression(p1, p2, f | regbase::use_except);
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a)
|
||||
: data(a), pkmp(0), error_code_(REG_EMPTY)
|
||||
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
|
||||
{
|
||||
set_expression(p, p + len, f | regbase::use_except);
|
||||
}
|
||||
|
||||
template <class charT, class traits, class Allocator>
|
||||
reg_expression<charT, traits, Allocator>::reg_expression(const reg_expression<charT, traits, Allocator>& e)
|
||||
: regbase(e), data(e.allocator()), pkmp(0), error_code_(REG_EMPTY)
|
||||
: regbase(e), data(e.allocator()), pkmp(0), error_code_(REG_EMPTY), _expression(0)
|
||||
{
|
||||
//
|
||||
// we do a deep copy only if e is a valid expression, otherwise fail.
|
||||
@ -1379,12 +1379,12 @@ unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::set_express
|
||||
{
|
||||
((re_detail::re_jump*)dat)->alt.i = data.size();
|
||||
mark.pop();
|
||||
dat = (re_detail::re_jump*)((unsigned char*)data.data() + mark.peek());
|
||||
if(mark.empty())
|
||||
{
|
||||
fail(REG_EPAREN);
|
||||
return error_code();
|
||||
}
|
||||
dat = (re_detail::re_jump*)((unsigned char*)data.data() + mark.peek());
|
||||
}
|
||||
|
||||
dat = add_simple(0, re_detail::syntax_element_endmark, sizeof(re_detail::re_brace));
|
||||
|
@ -348,9 +348,10 @@ struct BOOST_RE_IX_DECL w32_traits_base : public regex_traits_base
|
||||
char_class_upper = C1_UPPER,
|
||||
char_class_xdigit = C1_XDIGIT,
|
||||
char_class_blank = C1_BLANK,
|
||||
char_class_underscore = 0x0200,
|
||||
char_class_underscore = 0x0400,
|
||||
char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore,
|
||||
char_class_unicode = 0x0400
|
||||
char_class_unicode = 0x0800,
|
||||
char_class_win = C1_ALPHA | C1_CNTRL | C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_SPACE | C1_XDIGIT | C1_BLANK
|
||||
};
|
||||
public:
|
||||
static std::string BOOST_RE_CALL set_message_catalogue(const std::string& s);
|
||||
|
@ -32,6 +32,13 @@
|
||||
|
||||
#if defined(_WIN32) && !defined(BOOST_RE_NO_W32)
|
||||
|
||||
//
|
||||
// VC6 needs to link to user32.lib:
|
||||
//
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma comment(lib, "user32.lib")
|
||||
#endif
|
||||
|
||||
namespace{
|
||||
|
||||
//
|
||||
@ -272,6 +279,10 @@ void BOOST_RE_CALL w32_traits_base::do_init()
|
||||
}
|
||||
buf[map_size] = (char)0;
|
||||
GetStringTypeA(GetUserDefaultLCID(), CT_CTYPE1, buf, map_size, class_map);
|
||||
for(i = 0; i < map_size; ++i)
|
||||
{
|
||||
class_map[i] &= char_class_win;
|
||||
}
|
||||
class_map['_'] |= char_class_underscore;
|
||||
LCMapStringA(GetUserDefaultLCID(), LCMAP_LOWERCASE, buf, map_size, lower_case_map, map_size);
|
||||
//
|
||||
@ -654,7 +665,7 @@ bool BOOST_RE_CALL w32_regex_traits<wchar_t>::do_iswclass(wchar_t c, boost::uint
|
||||
if(f & char_class_unicode)
|
||||
return true;
|
||||
else if(isPlatformNT && GetStringTypeW(CT_CTYPE1, &c, 1, &mask))
|
||||
return BOOST_RE_MAKE_BOOL(mask & f);
|
||||
return BOOST_RE_MAKE_BOOL(mask & f &char_class_win);
|
||||
else if((f & char_class_graph) == char_class_graph)
|
||||
return true; // all wide characters are considered "graphics"
|
||||
return false;
|
||||
|
File diff suppressed because it is too large
Load Diff
65
test/Jamfile
Normal file
65
test/Jamfile
Normal file
@ -0,0 +1,65 @@
|
||||
subproject libs/regex/test ;
|
||||
|
||||
|
||||
exe regress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe wregress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
<define>TEST_UNICODE=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe posix_api_check_c : c_compiler_checks/posix_api_check.c
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe wide_posix_api_check_c : c_compiler_checks/wide_posix_api_check.c
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe posix_api_check : c_compiler_checks/posix_api_check.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
exe wide_posix_api_check : c_compiler_checks/wide_posix_api_check.cpp
|
||||
<lib>../build/libboost_regex$(SUFLIB)
|
||||
:
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>BOOST_RE_NO_LIB=1
|
||||
:
|
||||
debug
|
||||
<runtime-link>dynamic
|
||||
;
|
||||
|
||||
|
Reference in New Issue
Block a user