Minor regex fixes for VC6 (Added some boost:: qualifies to work around lack or Koenig lookup).

[SVN r8238]
This commit is contained in:
John Maddock
2000-11-17 11:35:02 +00:00
parent 36e4289aaa
commit c0399a3a57
8 changed files with 19 additions and 12 deletions

View File

@ -54,7 +54,7 @@ regbase::flag_type f = regbase::escape_in_lists | regbase::char_classes | regbas
| regbase::bk_parens | regbase::bk_refs | regbase::bk_vbar | regbase::use_except
| regbase::failbit | regbase::literal | regbase::icase | regbase::nocollate | regbase::basic
| regbase::extended | regbase::normal | regbase::emacs | regbase::awk | regbase::grep | regbase::egrep | regbase::sed;
#if 0
template class reg_expression<test_char_type>;
template class sub_match<ra_it>;
template class match_results<ra_it>;
@ -163,7 +163,6 @@ template test_string_type regex_merge(const test_string_type&,
unsigned int flags);
#endif
#endif
} // namespace boost
@ -199,3 +198,4 @@ template test_string_type regex_merge(const test_string_type&,
#include "libs/regex/src/regex_synch.cpp"
#include "libs/regex/src/wide_posix_api.cpp"

View File

@ -5,7 +5,7 @@
bool validate_card_format(const std::string& s)
{
static const boost::regex e("(\\d{4}[- ]){3}\\d{4}");
return regex_match(s, e);
return boost::regex_match(s, e);
}
const boost::regex e("\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z");
@ -14,12 +14,12 @@ const std::string human_format("\\1-\\2-\\3-\\4");
std::string machine_readable_card_number(const std::string& s)
{
return regex_merge(s, e, machine_format, boost::match_default | boost::format_sed);
return boost::regex_merge(s, e, machine_format, boost::match_default | boost::format_sed);
}
std::string human_readable_card_number(const std::string& s)
{
return regex_merge(s, e, human_format, boost::match_default | boost::format_sed);
return boost::regex_merge(s, e, human_format, boost::match_default | boost::format_sed);
}
#include <iostream>
@ -43,3 +43,4 @@ int main()
}
return 0;
}

View File

@ -40,7 +40,7 @@ void IndexClasses(map_type& m, const std::string& file)
end = file.end();
boost::match_results<std::string::const_iterator> what;
unsigned int flags = boost::match_default;
while(regex_search(start, end, what, expression, flags))
while(boost::regex_search(start, end, what, expression, flags))
{
// what[0] contains the whole string
// what[5] contains the class name.
@ -103,3 +103,4 @@ int main(int argc, const char** argv)

View File

@ -56,7 +56,7 @@ void IndexClasses(map_type& m, const std::string& file)
std::string::const_iterator start, end;
start = file.begin();
end = file.end();
regex_grep(IndexClassesPred(m, start), start, end, expression);
boost::regex_grep(IndexClassesPred(m, start), start, end, expression);
}
@ -104,3 +104,4 @@ int main(int argc, const char** argv)

View File

@ -72,12 +72,12 @@ int main(int argc, const char** argv)
// temporary string stream
std::ostringstream t(std::ios::out | std::ios::binary);
std::ostream_iterator<char, char> oi(t);
regex_merge(oi, in.begin(), in.end(), e2, pre_format);
boost::regex_merge(oi, in.begin(), in.end(), e2, pre_format);
// then output to final output stream
// adding syntax highlighting:
std::string s(t.str());
std::ostream_iterator<char, char> out(os);
regex_merge(out, s.begin(), s.end(), e1, format_string);
boost::regex_merge(out, s.begin(), s.end(), e1, format_string);
os << footer_text;
}
return 0;
@ -128,3 +128,4 @@ const char* footer_text = "</PRE>\n</BODY>\n\n";

View File

@ -53,7 +53,7 @@ void IndexClasses(const std::string& file)
start = file.begin();
end = file.end();
base = start;
regex_grep(grep_callback, start, end, expression);
boost::regex_grep(grep_callback, start, end, expression);
}
#include <fstream>
@ -96,3 +96,4 @@ int main(int argc, const char** argv)
}
return 0;
}

View File

@ -66,7 +66,7 @@ void class_index::IndexClasses(const std::string& file)
start = file.begin();
end = file.end();
base = start;
regex_grep(std::bind1st(std::mem_fun(&class_index::grep_callback), this),
boost::regex_grep(std::bind1st(std::mem_fun(&class_index::grep_callback), this),
start,
end,
expression);
@ -115,3 +115,4 @@ int main(int argc, const char** argv)
}

View File

@ -69,7 +69,7 @@ void class_index::IndexClasses(const std::string& file)
end = file.end();
base = start;
class_index::grep_callback_type cl = &(this->grep_callback);
regex_grep(cl,
boost::regex_grep(cl,
start,
end,
expression);
@ -118,3 +118,4 @@ int main(int argc, const char** argv)
}