I'm looking for a way to replace what i'd call garbage text on a doc-xml file to replace with values
I have this program, that can grab a doc-xml to print out contracts, where the user only need to feed the program with a doc-xml file format where there will be some parameters that my program will replace with values
lets say I have this chunk of a contract format
The Contract {@ContractNumber} specified to the contractor {@ContractorName}....
My program looks for this parameters {@ContractNumber} and {@ContractorName} to replace with the Contract values, and i'm only asking the user to have it in a XML-DOC format, but sometimes the file it written like this
<w:p w:rsidR="0094616E" w:rsidRDefault="00AC620A"><w:pPr><w:rPr><w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/><w:color w:val="000000"/><w:sz w:val="24"/><w:szCs w:val="24"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/><w:color w:val="000000"/><w:sz w:val="24"/><w:szCs w:val="24"/></w:rPr><w:t>{@</w:t></w:r><w:proofErr w:type="spellStart"/><w:r><w:rPr><w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/><w:color w:val="000000"/><w:sz w:val="24"/><w:szCs w:val="24"/></w:rPr><w:t>ContractorNumber</w:t></w:r>
and sometime it will do what i'm really hoping for
<w:p w:rsidR="0094616E" w:rsidRDefault="0094616E"><w:pPr><w:rPr><w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/><w:color w:val="000000"/><w:sz w:val="24"/><w:szCs w:val="24"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/><w:color w:val="000000"/><w:sz w:val="24"/><w:szCs w:val="24"/></w:rPr><w:t>{@Value1}</w:t></w:r></w:p>
SO, what i'm looking for it a RegEx replace statement where i can get rid of all the garbage that can be found between open chars of my params ({@) and the closure of it (}) so it can find the entire word i'm looking to be replaced with the value assigned to it
Edit 1:
For a simpler understanding of my question, what i'm looking for it a ReGex that will Find everything that is between a {@ and a subsequent } and when it finds <> delete them with everything within them so i have in the end {@Param} insted of {@ <garbage/> Param <garbage/> } or {@Param <garbage/> } or {@Pa <garbage/> am}
Edit 2:
So far, the most helpfull regex has been this one
{.*?@.*?}
Giving me a result like this
{</w:t></w:r><w:r><w:t>@Contrato</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>Obrigado</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>Adquisicion</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>Import</w:t></w:r><w:r><w:t>e</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>Acreditado</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>ImporteLetras</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>O</w:t></w:r><w:r><w:t>ficio</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>FechaOficio</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>Gracia</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>M</w:t></w:r><w:r><w:t>ensualidad-Gracia</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>ImporteMensualidad</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>I</w:t></w:r><w:r><w:t>mporteMensualidadLetra</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>D</w:t></w:r><w:r><w:t>ireccionAcreditada</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>EdoC</w:t></w:r><w:r><w:t>ivilAcreditado</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>CiudadOri</w:t></w:r><w:r><w:t>genAcredi</w:t></w:r><w:r><w:t>t</w:t></w:r><w:r><w:t>a</w:t></w:r><w:r><w:t>do</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>IFE</w:t></w:r><w:r><w:t>Acreditado</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>Sexo</w:t></w:r><w:r><w:t>Acreditado}
{@</w:t></w:r><w:r><w:t>EdoCivilAval</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>CiudadOrigenAval</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>IFEAval</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>S</w:t></w:r><w:r><w:t>e</w:t></w:r><w:r><w:t>xoAval</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>NumeroAmortizacion</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>DireccionAval</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>ProgramaCredito</w:t></w:r><w:r><w:t>}
{@</w:t></w:r><w:r><w:t>Por</w:t></w:r><w:r><w:t>cComisionAper</w:t></w:r><w:r><w:t>tura</w:t></w:r><w:r><w:t>}
now, i need is for the Regex to get rid of all those and that are between the characters, cant seem to find a way to delete those :S