Replacing tokens

Hi all,

I have a variable with value

DateFileFormat=NAME.CODE.CON.01.#.S001.V1.D$.hent.txt

I want this variable to get replaced with :

var2 is a variable with string value

DateFileFormat=NAME\\.CODE\\.CON\\.01\\.var2\\.S001\\.V1\\.D[0-9]+\\.hent\\.txt\\.xml$

Please Help

sed 's/\./.\\\\/g'

Hi tony,

The point is i want to get the replaced string in a variable

Thanks to TonyLawrence

YOURVAR=$(echo DateFileFormat | sed 's/\./.\\\\/g')

our using backticks

YOURVAR=`echo DateFileFormat | sed 's/\./.\\\\/g'`