The syntax for /fill in the help menu (/help fill or just /fill) will show:
/fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> [DataValue] [oldBlockHandling] [dataTag]
However, when [oldBlockHandling] is replace, you can optionally choose a block where [dataTag] would be which would only replace that block type with the block in <TileName>. The help syntax for /fill does not accommodate for that optional feature and there should be a separate syntax for /fill replace:
/fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> [DataValue] [oldBlockHandling] [replacedTile]
or
/fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> [DataValue] replace [replacedTile]