I trying to create a regex to match a portion of text in my word document. in the word document I have something like this {LigneDetails.Libelle} so when I treat this file with java it generates like this :
<w:t>{</w:t>
</w:r>
<w:proofErr w:type="spellStart" />
<w:r w:rsidRPr="009664EA">
<w:t>SOCIETE.RaisonSociale</w:t>
</w:r>
<w:proofErr w:type="spellEnd" />
<w:r w:rsidRPr="009664EA">
<w:t>}</w:t>
so here I match that text between the curved brackets using this regex : \\{([^\\{])*\\}
, this will return :
{</w:t>
</w:r>
<w:proofErr w:type="spellStart" />
<w:r w:rsidRPr="009664EA">
<w:t>SOCIETE.RaisonSociale</w:t>
</w:r>
<w:proofErr w:type="spellEnd" />
<w:r w:rsidRPr="009664EA">
<w:t>}
Now in my word document I have something like this : {LigneDetails.Libelle:FAM:01}
This will generate :
<w:t>{</w:t>
</w:r>
<w:proofErr w:type="spellStart" />
<w:r w:rsidRPr="002A51DD">
<w:rPr>
<w:sz w:val="14" />
<w:szCs w:val="20" />
</w:rPr>
<w:t>LigneDetails.Libelle:FAM</w:t>
</w:r>
<w:proofErr w:type="spellEnd" />
<w:r w:rsidRPr="002A51DD">
<w:rPr>
<w:sz w:val="14" />
<w:szCs w:val="20" />
</w:rPr>
<w:t>:01}</w:t>
then the regex will match the portion :
{</w:t>
</w:r>
<w:proofErr w:type="spellStart" />
<w:r w:rsidRPr="002A51DD">
<w:rPr>
<w:sz w:val="14" />
<w:szCs w:val="20" />
</w:rPr>
<w:t>LigneDetails.Quantite:FAM</w:t>
</w:r>
<w:proofErr w:type="spellEnd" />
<w:r w:rsidRPr="002A51DD">
<w:rPr>
<w:sz w:val="14" />
<w:szCs w:val="20" />
</w:rPr>
<w:t>:01}
until now all is fine.
Now I want to match the last two values which is always come after :
, in my case that would be FAM
and 01
so I want this regex to return these two values.
how can I do that ?