A
Al
Hi,
I have the following code :
string sData=@"{\*\bkmkstart adresse1} FORMTEXT }{\rtlch \af0 \ltrch
\f1\fs22\insrsid16733897\charrsid10567516 {\*\datafield
000000000000000008616472657373653100000000000000000000000000}{\*\formfield{\fftype0\fftypetxt0{\*\ffname
adresse1}}}}}{\fldrslt {\rtlch \af0 \ltrch
\f1\fs22\lang1024\langfe1024\noproof\insrsid10567516
\u8194\'20\u8194\'20\u8194\'20\u8194\'20\u8194\'20}}}{\rtlch \af0
\ltrch \f1\fs22\insrsid14636597 {\*\bkmkend adresse1}";
string sReg = @"\{\\fldrslt \{\\rtlch.*sid[0-9]+ ";
Regex reg = new Regex(sReg,
RegexOptions.IgnoreCase|RegexOptions.Singleline);
MatchCollection mc = reg.Matches(sData);
string sResult = mc[0].Value;
sResult displays the following :
{\fldrslt {\rtlch \af0 \ltrch
\f1\fs22\lang1024\langfe1024\noproof\insrsid10567516
\u8194\'20\u8194\'20\u8194\'20\u8194\'20\u8194\'20}}}{\rtlch \af0
\ltrch \f1\fs22\insrsid14636597
In other words, it returns the !!! last !!! 'sid' contained in a
'{\rtlch' itself contained in a '{\fldrslt', followed by a certain
number of numbers and followed by a space.
But what I want is the following result:
{\fldrslt {\rtlch \af0 \ltrch
\f1\fs22\lang1024\langfe1024\noproof\insrsid10567516
In other words, I want regex to stop at the first 'sid' contained in a
'{\rtlch' itself contained in a '{\fldrslt', followed by a certain
number of numbers and followed by a space.
Can anyone give me the solution ?
Thanks
Al
I have the following code :
string sData=@"{\*\bkmkstart adresse1} FORMTEXT }{\rtlch \af0 \ltrch
\f1\fs22\insrsid16733897\charrsid10567516 {\*\datafield
000000000000000008616472657373653100000000000000000000000000}{\*\formfield{\fftype0\fftypetxt0{\*\ffname
adresse1}}}}}{\fldrslt {\rtlch \af0 \ltrch
\f1\fs22\lang1024\langfe1024\noproof\insrsid10567516
\u8194\'20\u8194\'20\u8194\'20\u8194\'20\u8194\'20}}}{\rtlch \af0
\ltrch \f1\fs22\insrsid14636597 {\*\bkmkend adresse1}";
string sReg = @"\{\\fldrslt \{\\rtlch.*sid[0-9]+ ";
Regex reg = new Regex(sReg,
RegexOptions.IgnoreCase|RegexOptions.Singleline);
MatchCollection mc = reg.Matches(sData);
string sResult = mc[0].Value;
sResult displays the following :
{\fldrslt {\rtlch \af0 \ltrch
\f1\fs22\lang1024\langfe1024\noproof\insrsid10567516
\u8194\'20\u8194\'20\u8194\'20\u8194\'20\u8194\'20}}}{\rtlch \af0
\ltrch \f1\fs22\insrsid14636597
In other words, it returns the !!! last !!! 'sid' contained in a
'{\rtlch' itself contained in a '{\fldrslt', followed by a certain
number of numbers and followed by a space.
But what I want is the following result:
{\fldrslt {\rtlch \af0 \ltrch
\f1\fs22\lang1024\langfe1024\noproof\insrsid10567516
In other words, I want regex to stop at the first 'sid' contained in a
'{\rtlch' itself contained in a '{\fldrslt', followed by a certain
number of numbers and followed by a space.
Can anyone give me the solution ?
Thanks
Al