mirror of
https://github.com/boostorg/regex.git
synced 2025-07-16 13:52:17 +02:00
Fixed typos (mainly in comments)
This commit is contained in:
@ -303,7 +303,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_state(syntax_element_
|
|||||||
// set the offset to the next state in our last one:
|
// set the offset to the next state in our last one:
|
||||||
if(m_last_state)
|
if(m_last_state)
|
||||||
m_last_state->next.i = m_pdata->m_data.size() - getoffset(m_last_state);
|
m_last_state->next.i = m_pdata->m_data.size() - getoffset(m_last_state);
|
||||||
// now actually extent our data:
|
// now actually extend our data:
|
||||||
m_last_state = static_cast<re_syntax_base*>(m_pdata->m_data.extend(s));
|
m_last_state = static_cast<re_syntax_base*>(m_pdata->m_data.extend(s));
|
||||||
// fill in boilerplate options in the new state:
|
// fill in boilerplate options in the new state:
|
||||||
m_last_state->next.i = 0;
|
m_last_state->next.i = 0;
|
||||||
|
@ -51,7 +51,7 @@ typedef enum _match_flags
|
|||||||
match_any = match_init << 1, /* don't care what we match */
|
match_any = match_init << 1, /* don't care what we match */
|
||||||
match_not_null = match_any << 1, /* string can't be null */
|
match_not_null = match_any << 1, /* string can't be null */
|
||||||
match_continuous = match_not_null << 1, /* each grep match must continue from */
|
match_continuous = match_not_null << 1, /* each grep match must continue from */
|
||||||
/* uninterupted from the previous one */
|
/* uninterrupted from the previous one */
|
||||||
match_partial = match_continuous << 1, /* find partial matches */
|
match_partial = match_continuous << 1, /* find partial matches */
|
||||||
|
|
||||||
match_stop = match_partial << 1, /* stop after first match (grep) V3 only */
|
match_stop = match_partial << 1, /* stop after first match (grep) V3 only */
|
||||||
@ -61,7 +61,7 @@ typedef enum _match_flags
|
|||||||
match_posix = match_perl << 1, /* Use POSIX matching rules */
|
match_posix = match_perl << 1, /* Use POSIX matching rules */
|
||||||
match_nosubs = match_posix << 1, /* don't trap marked subs */
|
match_nosubs = match_posix << 1, /* don't trap marked subs */
|
||||||
match_extra = match_nosubs << 1, /* include full capture information for repeated captures */
|
match_extra = match_nosubs << 1, /* include full capture information for repeated captures */
|
||||||
match_single_line = match_extra << 1, /* treat text as single line and ignor any \n's when matching ^ and $. */
|
match_single_line = match_extra << 1, /* treat text as single line and ignore any \n's when matching ^ and $. */
|
||||||
match_unused1 = match_single_line << 1, /* unused */
|
match_unused1 = match_single_line << 1, /* unused */
|
||||||
match_unused2 = match_unused1 << 1, /* unused */
|
match_unused2 = match_unused1 << 1, /* unused */
|
||||||
match_unused3 = match_unused2 << 1, /* unused */
|
match_unused3 = match_unused2 << 1, /* unused */
|
||||||
@ -70,9 +70,9 @@ typedef enum _match_flags
|
|||||||
format_perl = 0, /* perl style replacement */
|
format_perl = 0, /* perl style replacement */
|
||||||
format_default = 0, /* ditto. */
|
format_default = 0, /* ditto. */
|
||||||
format_sed = match_max << 1, /* sed style replacement. */
|
format_sed = match_max << 1, /* sed style replacement. */
|
||||||
format_all = format_sed << 1, /* enable all extentions to sytax. */
|
format_all = format_sed << 1, /* enable all extensions to syntax. */
|
||||||
format_no_copy = format_all << 1, /* don't copy non-matching segments. */
|
format_no_copy = format_all << 1, /* don't copy non-matching segments. */
|
||||||
format_first_only = format_no_copy << 1, /* Only replace first occurance. */
|
format_first_only = format_no_copy << 1, /* Only replace first occurrence. */
|
||||||
format_is_if = format_first_only << 1, /* internal use only. */
|
format_is_if = format_first_only << 1, /* internal use only. */
|
||||||
format_literal = format_is_if << 1, /* treat string as a literal */
|
format_literal = format_is_if << 1, /* treat string as a literal */
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ inline match_flags& operator^=(match_flags& m1, match_flags m2)
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* namespace regex_constants */
|
} /* namespace regex_constants */
|
||||||
/*
|
/*
|
||||||
* import names into boost for backwards compatiblity:
|
* import names into boost for backwards compatibility:
|
||||||
*/
|
*/
|
||||||
using regex_constants::match_flag_type;
|
using regex_constants::match_flag_type;
|
||||||
using regex_constants::match_default;
|
using regex_constants::match_default;
|
||||||
|
@ -46,7 +46,7 @@ template <class S, class charT>
|
|||||||
unsigned count_chars(const S& s, charT c)
|
unsigned count_chars(const S& s, charT c)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Count how many occurances of character c occur
|
// Count how many occurrences of character c occur
|
||||||
// in string s: if c is a delimeter between collation
|
// in string s: if c is a delimeter between collation
|
||||||
// fields, then this should be the same value for all
|
// fields, then this should be the same value for all
|
||||||
// sort keys:
|
// sort keys:
|
||||||
|
@ -161,7 +161,7 @@ A marked parenthesis.
|
|||||||
struct re_brace : public re_syntax_base
|
struct re_brace : public re_syntax_base
|
||||||
{
|
{
|
||||||
// The index to match, can be zero (don't mark the sub-expression)
|
// The index to match, can be zero (don't mark the sub-expression)
|
||||||
// or negative (for perl style (?...) extentions):
|
// or negative (for perl style (?...) extensions):
|
||||||
int index;
|
int index;
|
||||||
bool icase;
|
bool icase;
|
||||||
};
|
};
|
||||||
|
@ -148,7 +148,7 @@ void test_search(const char* expression, const char* text, bool isperl = false,
|
|||||||
{
|
{
|
||||||
double time = exec_timed_test([&]() { return (*i)->find_all(text); });
|
double time = exec_timed_test([&]() { return (*i)->find_all(text); });
|
||||||
report_execution_time(time, table, row, heading);
|
report_execution_time(time, table, row, heading);
|
||||||
std::cout << "Search with library: " << heading << " found " << last_value_returned << " occurances.\n";
|
std::cout << "Search with library: " << heading << " found " << last_value_returned << " occurrences.\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ void test_deprecated(const char&, const test_regex_search_tag&)
|
|||||||
BOOST_REGEX_TEST_ERROR("Expression : \"" << expression.c_str() << "\" did not compile with the POSIX C API.", char);
|
BOOST_REGEX_TEST_ERROR("Expression : \"" << expression.c_str() << "\" did not compile with the POSIX C API.", char);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// try and find the first occurance:
|
// try and find the first occurrence:
|
||||||
static const unsigned max_subs = 100;
|
static const unsigned max_subs = 100;
|
||||||
boost::regmatch_t matches[max_subs];
|
boost::regmatch_t matches[max_subs];
|
||||||
if(boost::regexecA(&re, search_text.c_str(), max_subs, matches, posix_match_options) == 0)
|
if(boost::regexecA(&re, search_text.c_str(), max_subs, matches, posix_match_options) == 0)
|
||||||
@ -227,7 +227,7 @@ void test_deprecated(const wchar_t&, const test_regex_search_tag&)
|
|||||||
BOOST_REGEX_TEST_ERROR("Expression : \"" << expression.c_str() << "\" did not compile with the POSIX C API.", wchar_t);
|
BOOST_REGEX_TEST_ERROR("Expression : \"" << expression.c_str() << "\" did not compile with the POSIX C API.", wchar_t);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// try and find the first occurance:
|
// try and find the first occurrence:
|
||||||
static const unsigned max_subs = 100;
|
static const unsigned max_subs = 100;
|
||||||
boost::regmatch_t matches[max_subs];
|
boost::regmatch_t matches[max_subs];
|
||||||
if(boost::regexecW(&re, search_text.c_str(), max_subs, matches, posix_match_options) == 0)
|
if(boost::regexecW(&re, search_text.c_str(), max_subs, matches, posix_match_options) == 0)
|
||||||
|
@ -98,7 +98,7 @@ void test_replace()
|
|||||||
TEST_REGEX_REPLACE("(?<one>a+)|(?<two>b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all, "(?{one}A:B)C", "...ACBC,,,ACBC*ACBC?");
|
TEST_REGEX_REPLACE("(?<one>a+)|(?<two>b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all, "(?{one}A:B)C", "...ACBC,,,ACBC*ACBC?");
|
||||||
TEST_REGEX_REPLACE("(?<one>a+)|(?<two>b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all, "?{one}:B", "...B,,,B*B?");
|
TEST_REGEX_REPLACE("(?<one>a+)|(?<two>b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all, "?{one}:B", "...B,,,B*B?");
|
||||||
|
|
||||||
// move to copying unmatched data, but replace first occurance only:
|
// move to copying unmatched data, but replace first occurrence only:
|
||||||
TEST_REGEX_REPLACE("a+", perl, "...aaa,,,", match_default|format_all|format_first_only, "bbb", "...bbb,,,");
|
TEST_REGEX_REPLACE("a+", perl, "...aaa,,,", match_default|format_all|format_first_only, "bbb", "...bbb,,,");
|
||||||
TEST_REGEX_REPLACE("a+(b+)", perl, "...aaabb,,,", match_default|format_all|format_first_only, "$1", "...bb,,,");
|
TEST_REGEX_REPLACE("a+(b+)", perl, "...aaabb,,,", match_default|format_all|format_first_only, "$1", "...bb,,,");
|
||||||
TEST_REGEX_REPLACE("a+(b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all|format_first_only, "$1", "...bb,,,ab*abbb?");
|
TEST_REGEX_REPLACE("a+(b+)", perl, "...aaabb,,,ab*abbb?", match_default|format_all|format_first_only, "$1", "...bb,,,ab*abbb?");
|
||||||
|
Reference in New Issue
Block a user