boostorg / boostorg/regex

boost::u32regex_replace() behavior when the string has a closing newline

Open
#175 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
119
Forks
113
PR merge metrics
No merged PRs in 30d

Description

It seems that boost::u32regex_replace() matches a newline with ^(.*)$ different when it is at the end of a string and not within the string.

Input: "line\nline\nline\n"
Regular expression: "^(.*)$"
Format: "Hallo\\1"
Result: "Halloline\nline\nline\nHallo

Is this example intended to result in two matches and substitutions?

[code.txt](https://github.com/boostorg/regex/files/8715090/code.txt)
[output.txt](https://github.com/boostorg/regex/files/8715092/output.txt)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.