Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
RegExpress
//g++ 7.4.0 ///////////////////////////////////////////////////////////////////////////// //RegExpress //this code is created by Rezaul Hoque on July 05,2022; //contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; ////////////////////////////////////////////////////////////////////////////// #include <iostream> #include <string> #include <regex> #include <iterator> int main() { std::string a="It's Tuesday! Time for a walk!\n"; std::regex WC("(\\w+)"); auto startWc=std::sregex_iterator(a.begin(),a.end(),WC); auto endWc=std::sregex_iterator (); std::cout<<"There are "<<std::distance (startWc,endWc)<<" words.\n"; std::regex look("Tuesday"); std::regex_replace(std::ostreambuf_iterator<char>(std::cout),a.begin(),a.end(),look,"__"); std::cout<<std::regex_replace(a,look,"[$&]"); return 0; }
run
|
edit
|
history
|
help
0
Date n Time Macros
cppPyPoly2
Minimum Vertices to Traverse Directed Graph
Ballin primality test
simple calculator
Following order Indegree
Test 13(2020)
linkage
MatrixVectorConversion
maximize the difference