- or download this
wine@localhost]$ perl -pe 's/(")[^\1]*\1/check/g'
"strings 1" "string 2" # input
check #output
- or download this
wine@localhost]$ perl -pe 's/"[^"]*"/check/g'
"string 1" "string 2"
check check
- or download this
wine@localhost]$ perl -pe 's/(")[^$1]*$1/check/g'
"string 1" "string 2"
Unmatched [ before HERE mark in regex m/(")[ << HERE ^]*/ at -e line 1
+, <> line 1.
- or download this
wine@localhost]$ perl -pe 's/(a)[^\1]*\1/check/g'
abbbba abbbbbbbba
check
- or download this
# ("|'"'"') is a complex bash escape for ("|')
wine@localhost]$ perl -pe 's/("|'"'"')[^\1]*\1/check/g'
"aaa" 'aaa'
check check
- or download this
perl -pe 's/("|'"'"')[^\1]*\1/check/g'
"aaa" "aaa"
check
- or download this
wine@localhost]$ sed 's/\(a\)[^\1]*\1/check/g'
abbbba abbbbbbbba
check