Help with sed command - find a string between two characters

view story

http://www.unix.com – Hi, I have a xml file (Config.xml) Code: <Header name="[Measure]" TDate="[COB]" PDate="[PCOB]">         <Config>                 {"config" { "Nation" "Pri:[Region]|Sec:[SecRegion]"}}         </Config> </Header> Now I wanted to printed all the strings between "[" and "]". I tried the following Code: cat Config.xml | sed -n 's/.*\[//;s/\].*//p' But its only printing below strings (the last occu (HowTos)