G
Guest
Hey,
I have following string :
blabla {\*\bkmkstart test1}{\*\bkmkend test1} line1 {\*\bkmkstart
test2}{\*\bkmkend test2}
I want to change the string to the following with regex.
blabla &test1& line1 &test2&
I do the following :
strTemplate = Regex.Replace(strTemplate,@"{\\[*]\\bkmkstart ","&");
strTemplate = Regex.Replace(strTemplate,@"}{\\[*]\\bkmkend.*}","&");
The result after the first replace is (correct) :
blabla & test1}{\*\bkmkend test1} line1 & test2}{\*\bkmkend test2}
After the second replace :
blabla & test1&
I loose the rest of the string. I think there is a problem with the last }
in my expression.
I want to replace exactly this string "}{\\[*]\\bkmkend.*}" not less not
more. } is the last character of my string.
May be it is .* how gives me problems, but .* has to stop after the first }
he see.
How can I resolute this problem.
thanks for help.
I have following string :
blabla {\*\bkmkstart test1}{\*\bkmkend test1} line1 {\*\bkmkstart
test2}{\*\bkmkend test2}
I want to change the string to the following with regex.
blabla &test1& line1 &test2&
I do the following :
strTemplate = Regex.Replace(strTemplate,@"{\\[*]\\bkmkstart ","&");
strTemplate = Regex.Replace(strTemplate,@"}{\\[*]\\bkmkend.*}","&");
The result after the first replace is (correct) :
blabla & test1}{\*\bkmkend test1} line1 & test2}{\*\bkmkend test2}
After the second replace :
blabla & test1&
I loose the rest of the string. I think there is a problem with the last }
in my expression.
I want to replace exactly this string "}{\\[*]\\bkmkend.*}" not less not
more. } is the last character of my string.
May be it is .* how gives me problems, but .* has to stop after the first }
he see.
How can I resolute this problem.
thanks for help.