Skip to content

regex \R with flag no_escape_in_lists does not match \v and \n #57

@youcefl

Description

@youcefl

I think this is a regression. The following code

#include <iostream>
#include <boost/regex.hpp>

int main(int argc, char** argv)
{
	auto backslashR = boost::regex("\\R", boost::regex_constants::no_escape_in_lists);

	std::cout << std::boolalpha;
	std::cout << "regex='\\R', text='\\r', match found: " << boost::regex_search("\r", backslashR) << std::endl;
	std::cout << "regex='\\R', text='\\n', match found: " << boost::regex_search("\n", backslashR) << std::endl;
	std::cout << "regex='\\R', text='\\v', match found: " << boost::regex_search("\v", backslashR) << std::endl;

	return 0;
}

outputs

regex='\R', text='\r', match found: true
regex='\R', text='\n', match found: true
regex='\R', text='\v', match found: true

using boost regex v1.55 and v1.64. Using version 1.66 I get this:

regex='\R', text='\r', match found: true
regex='\R', text='\n', match found: false
regex='\R', text='\v', match found: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions