can anyone help me with creating regex for escapging?
example1) shell> echo lll\\< kkkk\\\\\\ uuuu\\&
needs to print
lll< kkkk\\ uuuu&
example2) shell> echo \\"Hello hello1 hello2"\\
"Hello hello1 hello2"
excample3) shell> echo this is a question mark \\?
this is a question mark
You can use .+echo\\s|([\\\\?])\\1+|[\\\\?]
just you need replace this with $1
'([\\?])\\1+' - get any \\
or ?
that is duplicate and replace with one character by $1
'[\\?]' - and remove any \\
and ?
that is one
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.