I am currently trying to write a class function that changes each instance of a word to a string with another word Will give C ++ 11 Lib
in place of zero (std :: string subject, std :: string pattern, std :: string substitution) {std :: regex exp (pattern); Std :: cout & lt; & Lt; Std :: regex_replace (subject, XP, replacement); } (Std :: string ("Hello World"), std :: string ("world"), std :: string ("planet"); Do not return anything.
I think the problem is regular expression, but I have no idea and can not find anywhere that how to match regexp to a certain string in ECMAScript or any other available.
Does anyone know how to solve this problem?
For completeness: see Xaqq as
for reference.
Your task at MSVC 2012 works with the desired output.
Pre-replace ("Hello World", "^ (. *) World (. *) $", "$ 1 Planet $ 2"); Hello planet
No comments:
Post a Comment