bfgroup / b2

B2 makes it easy to build C++ projects, everywhere.
https://www.bfgroup.xyz/b2/
Boost Software License 1.0
80 stars 229 forks source link

There is something wrong with escaping \ in regex.replace #269

Closed Kojoley closed 1 year ago

Kojoley commented 1 year ago
import regex ;

local rule-name = gcc.mingw.link ;
local base = gcc ;
local toolset = clang-linux ;

ECHO [ MATCH ^($(base)\\.) : $(rule-name) ] ;
ECHO [ regex.replace $(rule-name) ^$(base)\\. $(toolset). ] ;
ECHO [ regex.replace-list $(rule-name) : ^$(base)\\. : $(toolset). ] ;
ECHO [ regex.replace $(rule-name) ^$(base)\\\\. $(toolset). ] ;
ECHO [ regex.replace-list $(rule-name) : ^$(base)\\\\. : $(toolset). ] ;
ECHO [ regex.replace $(rule-name) ^$(base)[.] $(toolset). ] ;
ECHO [ regex.replace-list $(rule-name) : ^$(base)[.] : $(toolset). ] ;
gcc.
clang-linux.mingw.link
clang-linux.mingw.link
gcc.mingw.link
gcc.mingw.link
clang-linux.mingw.link
clang-linux.mingw.link
Kojoley commented 1 year ago

I just messed up other things and the output is ok.