Search
 
SCRIPT & CODE EXAMPLE
 

CPP

use regex replace in c++

#include <string>
#include <regex>

std::string test = "abc def abc def";
test = std::regex_replace(test, std::regex("def"), "klm"); // replace 'def' -> 'klm'
// test = "abc klm abc klm"
Comment

PREVIOUS NEXT
Code Example
Cpp :: pass c++ 
Cpp :: if not defined c++ 
Cpp :: xmake set exe name 
Cpp :: remove value from vector c++ 
Cpp :: note++ 
Cpp :: c++ absolute value 
Cpp :: char vector to string c++ 
Cpp :: c++ get last character of string 
Cpp :: qstring to char* 
Cpp :: vector of int to string c++ 
Cpp :: setw in c++ 
Cpp :: sum of stack c++ 
Cpp :: spicoli 
Cpp :: c++ read integers from file 
Cpp :: initializing 2d vector 
Cpp :: c++ map iterator 
Cpp :: c++ shared pointer 
Cpp :: how to traverse a linked list in c++ 
Cpp :: how to check size of file in c++ 
Cpp :: print linked list reverse order in c++ 
Cpp :: how to iterate from second element in map c++ 
Cpp :: how to get length of a file in c++ 
Cpp :: for in c++ 
Cpp :: c++ reading string 
Cpp :: c++ fizzbuzz 
Cpp :: armstrong number in cpp 
Cpp :: minimum value in array using c++ 
Cpp :: get value of enum cpp 
Cpp :: c++ how to read from a file 
Cpp :: length of array in cpp 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =