ウィキペディアからダウンロードした xml ファイルからいくつかの引用符を削除します。これまでのところ、テキストは次のようになっています (改行は無視してください。読みやすくするためです)。
'''Anarchism''' is a political philosophy that advocates stateless societies based on
non-hierarchical free associations.<ref name="iaf-ifa.org"/><ref>"That is why
Anarchy, when it works to destroy authority in all its aspects, when it demands
the abrogation of laws and the abolition of the mechanism that serves to
impose them, when it refuses all hierarchical organization and preaches free agreement - at the same time strives to maintain and enlarge the precious kernel of social customs without which
no human or animal society can exist." Peter Kropotkin. http://www.theanarchistlibrary.org/HTML/Petr_Kropotkin__Anarchism__its_philosophy_and_ideal.html
Anarchism: its philosophy and ideal</ref><ref>"anarchists are opposed to irrational (e.g., illegitimate)
authority, in other words, hierarchy - hierarchy being the institutionalisation of authority
within a society." http://www.theanarchistlibrary.org/HTML/The_Anarchist_FAQ_Editorial_Collective__An_Anarchist_FAQ__03_17_.html#toc2 "B.1
Why are anarchists against authority and hierarchy?" in An
Anarchist FAQ</ref><ref>"ANARCHISM, a social philosophy that rejects
authoritarian government and maintains that voluntary institutions are best
suited to express man's natural social tendencies." George Woodcock. "Anarchism" at The Encyclopedia of Philosophy</ref><ref>"In a society developed on these lines, the voluntary
associations which already now begin to cover all the fields of human activity
would take a still greater extension so as to substitute themselves for the
state in all its functions." http://www.theanarchistlibrary.org/HTML/Petr_Kropotkin___Anarchism__from_the_Encyclopaedia_Britannica.html
Peter Kropotkin. "Anarchism" from the Encyclopædia Britannica</ref> Anarchism holds the state
to be undesirable, unnecessary, or harmful
このテキスト ブロックから欲しいのはこれだけです。
アナキズムは、非階層的な自由結社に基づく無国籍社会を提唱する政治哲学です。アナキズムは、国家を望ましくない、不必要、または有害であると考えています。
"<ref"
との間のすべてのテキストを"/ref>"
削除すると、必要な望ましくないテキストをすべてキャプチャして削除できるはずです。これは私が現時点で持っているコードです:
Dim temptext As String = newsrt.ToString
Dim expression As New Regex("(?<=\<ref)[^/ref>]+(?=/ref>)")
Dim resul As String = expression.Replace(temptext, "")
しかし、これはうまくいかないようです。<ref
との間のテキスト/ref>
はキャプチャされず、"" に置き換えられます。
どんな助けやアドバイスも素晴らしいでしょう!ありがとう。