thx for reply pradeep,

actually I have completed that task by some other way,

but what you have given is intresting I would like to work on it later...and ask any doubts

one immediate for me when I am looking at script is ( as not aware of RE in java script)
' RegExp.$1' do I need to place it as it is or is there any to I need to replace there..