fork(1) download
  1. #!/bin/bash
  2. s="a string like ['DB']['1']['HOST'] = 'localhost'."
  3. sed -En '/\[\x27HOST\x27\]\s?=\s?[\x27"][^\x27"]+[\x27"]/p' <<< "$s"
Success #stdin #stdout 0s 4484KB
stdin
Standard input is empty
stdout
a string like ['DB']['1']['HOST'] = 'localhost'.