Rust

Replace string using Regex in Rust

It’s way harder to begin working in Rust when compared to other programming languages for me.

Donald Le
Nov 9, 2020

--

For example we might want to find the certain regex “first: \d+”, which means the text has first: 200 for example, and replace that with the different value like first: 100.

In my case, after replace the text, I want to save that to file. How do we do that in Rust.

Above is the full code for doing it.

Hope it helps.

~~ PEACE ~~

--

--

Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.