Help for this page

Select Code to Download


  1. or download this
    wine@localhost]$ perl -pe 's/(")[^\1]*\1/check/g'
    "strings 1" "string 2" # input
    check #output
    
  2. or download this
    wine@localhost]$ perl -pe 's/"[^"]*"/check/g'
    "string 1" "string 2"
    check check
    
  3. 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.
    
  4. or download this
    wine@localhost]$ perl -pe 's/(a)[^\1]*\1/check/g'
    abbbba abbbbbbbba
    check
    
  5. or download this
    # ("|'"'"') is a complex bash escape for ("|')
    
    wine@localhost]$ perl -pe 's/("|'"'"')[^\1]*\1/check/g' 
    "aaa" 'aaa'
    check check
    
  6. or download this
    perl -pe 's/("|'"'"')[^\1]*\1/check/g'
    "aaa" "aaa"
    check
    
  7. or download this
    wine@localhost]$ sed 's/\(a\)[^\1]*\1/check/g'
    abbbba abbbbbbbba
    check