Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Regex replace text working only for few words (Problem please help)

$
0
0

I have for example this words in documents

firma_o, num_o, tel_o, etc..., firma_p, num_p, etc...  when I use Regex 

Regex regexText = new Regex("firma_o");
docText = regexText.Replace(docText, "Firma asd");
regexText = new Regex("ulica_o");
docText = regexText.Replace(docText, "xxx");
Regex regexText_Cislo = new Regex("cislo_o");
docText = regexText_Cislo.Replace(docText, "xxx");
regexText = new Regex("psc_o");
docText = regexText.Replace(docText, "xxx");
regexText = new Regex("mesto_o");
docText = regexText.Replace(docText, "xxx");

it rename only firma_o, when I rename firma and all other in to firmao, ulicao etc.. then it rename nothing.

I use vs 2015, Open XML SDK 2.5

How to rename text as I want in this example?

Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>