English 中文(简体)
C# , How to written RegEx. 替换xml元素的价值?
原标题:C# , How to write RegEx.Replace to replace value for an xml element?
  • 时间:2012-01-11 16:36:03
  •  标签:
  • c#
  • regex

有了Xml的扼杀,目标是将Xml的元素值改为固定的护卫,即,对真主党的真主党而言,用固定价值取代它,我想使用Ref。 取代将座标装上DOM模型并替换。

Could anyone please help on how to write this regular expression? essentially the goal is to match everything inside element tag abc

Thanks a lot!

最佳回答
问题回答

对它的价值来说,没有。

通常使用<代码>XmlDocument、Xml.LinqXmlReader/Writer处理XML,涵盖我们甚至想象的所有种类的对冲案件,最重要的是证明是行之有效的。

Don t use a regex for this, please . . . just don t.

我的两点。

删除

。 XML是一种非正式的语言。 因此,不能使用定期表达来适当禁止其中的任何文字。 你们将需要使用真正的XML教区,可在C#的众多图书馆找到。

常规表述不适合处理标记。 在其他缺陷中,如果能够把一些要素nes为nes,他们就赢得了工作:

<abc> ... <abc> ... </abc> ... </abc>

他们还无法将评论与非意见区分开来。

你们需要真正的XML教区。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签