微信公众号:rose1986
use std::fs::{
File, OpenOptions};
use std::process::Command;
use std::{
thread, time};
use std::io::{
BufReader, BufRead, Read, Write};
use regex::Regex;
use std::borrow::Cow;
// 不需转义 `, /!@#%&-_=:;"'<>.
// 需转义 \$^*()+{}[]|?
fn main() {
// mtTest();
// mtRw();
println!("----------------");
// let basePath="/home/jl73/.config/JetBrains/";
let basePath="/home/jl73/7-tmp/";
let dirNames=["CLion2020.2/clion","GoLand2020.2/goland","IntelliJIdea2020.2/idea","PyCharm2020.2/pycharm"];
// let strReplace="xalmos";
let rf = OpenOptions::new().read(true).open(basePath.to_owned()+"str").unwrap();
let reader = BufReader::new(rf);
let line=reader.lines().next();
// println!("{:?}",line ); //Some(Ok("12`!@#%&-_=:|}].90()@#^&$?&&&;\"\'<>/\\\\\\\\<>. \\$^*(\t\t\t\t)+{}[]|?`, /!@#%&-_=:;\"\'<>."))
let strReplace=line.unwrap().unwrap();
for dirName in dirNames.iter(){
mtRw2(basePath, dirName, &*strReplace)
}
}
fn mtChang(newStrr: Cow<str>) -> String {
let reCh=Regex::new("\\?"