Retrieve message from file

Hey all, I have this file which contains a lot of messages in format like

[2/2/07 13:23:00] This is my message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Check This!
[2/2/07 13:23:10] This is my second message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
[2/2/07 13:24:48] This is my third message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!

when I do "grep" on this file using "2/2/07 13:23", it returned

[2/2/07 13:23:00] This is my message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[2/2/07 13:23:10] This is my second message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

but in fact I want

[2/2/07 13:23:00] This is my message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Check This!
[2/2/07 13:23:10] This is my second message!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!

since these messages span over several lines, could anyone tell me how to achieve what I need? Thank you so much!

I assume that your message start with [ and span over multiple lines

awk ' /2\/2\/07 13:23/ { print ; getline ;while( match( $0 , "^[^\[]" ) ||  match( $0 ,"2\/2\/07 13:23") ) { print ; getline; } } ' file

Anbu,

Can we do this using FS and RS in awk.

This will work if [ is not anywhere other than the start of message

awk -v RS="[" ' /2\/2\/07 13:23/  { print "["$0 } ' file

And add this to adjust the ORS:

awk -v RS="[" -v ORS= '/2\/2\/07 13:23/{print RS$0}' infile

Or with sed:

sed -n '/\[2\/2\/07 13:23/,/\[2\/2\/07 13:23/{N;p;}' infile

Thanks & great radoulov..it was perfect.