0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
const char* def = "DEFINE";
while(*def && (m_position != m_end) && (*m_position == charT(*def)))
++m_position, ++def;
if((m_position == m_end) || *def)
{
// Rewind to start of (? sequence:
--m_position;
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
fail(regex_constants::error_perl_extension, m_position - m_base);
return false;
}
re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace)));
br->index = 9999; // special magic value!
if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)
{
// Rewind to start of (? sequence:
--m_position;
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
fail(regex_constants::error_perl_extension, m_position - m_base);
return false;
}
Фрагмент из boost::regex, "magic value!", улыбнуло =]
basic_regex_parser.hpp : 2160
Запостил:
rudvil ,
28.08.2010 (Updated 24.03.2018 )
Комментарии (0) RSS