假设我的文字包含以下标记:
<ref name="name">Some text</ref>
<ref name="adasd"/>
<!--Hello world-->
如何从文本中完全删除所有此类实例。我不想要标签之间的文字。 我试过这个:
text = text.replaceAll("(?s)<ref>(.*?)</ref>"," ");
请在下面的文字中试用你的正则表达式:
> [[File:Bakunin.png|thumb|upright|Collectivist anarchist [[Mikhail
> Bakunin]] opposed the [[Marxist]] aim of [[dictatorship of the
> proletariat]] in favour of universal rebellion, and allied himself
> with the federalists in the First International before his expulsion
> by the Marxists.<ref name=bbc/>]]In Europe, harsh reaction
> followed the [[revolutions of 1848]], during which ten countries had
> experienced brief or long-term social upheaval as groups carried out
> nationalist uprisings. After most of these attempts at systematic
> change ended in failure, conservative elements took advantage of the
> divided groups of socialists, anarchists, liberals, and nationalists,
> to prevent further revolt.<ref> </ref> In Spain Ramón de
> la Sagra established the anarchist journal ''El Porvenir'' in La
> Coruña in 1845 which was inspired by Proudhon´s ideas.<ref
> name="britannica.com"> </ref> The [[Catalan people|Catalan]]
> politician [[Francesc Pi i Margall]] became the principal translator
> of Proudhon's works into Spanish<ref>[[George Woodcock]].
> ''Anarchism: a history of libertarian movements''. Pg. 357</ref>
> and later briefly became president of Spain in 1873 while being the
> leader of the Democratic Republican Federal Party. According to George
> Woodcock "These translations were to have a profound and lasting
> effect on the development of Spanish anarchism after 1870, but before
> that time Proudhonian ideas, as interpreted by Pi, already provided
> much of the inspiration for the federalist movement which sprang up in
> the early 1860's."<ref>George Woodcock. ''Anarchism: a history
> of libertarian movements''. Pg. 357</ref> According to the
> ''[[Encyclopædia Britannica]]'' "During the Spanish revolution of
> 1873, Pi y Margall [[Cantonal Revolution|attempted to establish a
> decentralised, or "cantonalist," political system]] on Proudhonian
> lines."<ref name="britannica.com"/>In 1864 the [[International
> Workingmen's Association]] (sometimes called the "First
> International") united diverse revolutionary currents including French
> followers of Proudhon,<ref> </ref>
> [[Blanquism|Blanquists]], [[Philadelphes]], English trade unionists,
> socialists and [[social democrats]]. Due to its links to active
> workers' movements, the International became a significant
> organisation. [[Karl Marx]] became a leading figure in the
> International and a member of its General Council. Proudhon's
> followers, the mutualists, opposed Marx's [[state socialism]],
> advocating political [[abstentionism]] and small property
> holdings.<ref> </ref><ref> </ref> Woodcock
> also reports that the American individualist anarchists [[Lysander
> Spooner]] and [[William B. Greene]] had been members of the [[First
> International]].<ref name="Woodcock"> </ref> In 1868,
> following their unsuccessful participation in the [[League of Peace
> and Freedom]] (LPF), Russian revolutionary Mikhail Bakunin and his
> collectivist anarchist associates joined the First International
> (which had decided not to get involved with the LPF).<ref>
> </ref> They allied themselves with the [[federalist]] socialist
> sections of the International,<ref> </ref> who advocated
> the revolutionary overthrow of the state and the collectivisation of
> property.At first, the collectivists worked with the Marxists to push
> the First International in a more revolutionary socialist direction.
> Subsequently, the International became polarised into two camps, with
> Marx and Bakunin as their respective figureheads.<ref>
> </ref> [[Mikhail Bakunin]] characterised Marx's ideas as
> [[centralism|centralist]] and predicted that, if a Marxist party came
> to power, its leaders would simply take the place of the [[ruling
> class]] they had fought against.<ref name="bakuninmarx"
> /><ref> </ref> Anarchist historian George Woodcock
> reports that "The annual Congress of the International had not taken
> place in 1870 owing to the outbreak of the Paris Commune, and in 1871
> the General Council called only a special conference in London. One
> delegate was able to attend from Spain and none from Italy, while a
> technical excuse – that they had split away from the Fédération
> Romande – was used to avoid inviting Bakunin's Swiss supporters. Thus
> only a tiny minority of anarchists was present, and the General
> Council's resolutions passed almost unanimously. Most of them were
> clearly directed against Bakunin and his followers."<ref
> name="Anarchism 1962">[[George Woodcock]]. ''Anarchism: A History
> of Libertarian Ideas and Movements'' (1962)</ref> In 1872, the
> conflict climaxed with a final split between the two groups at the
> [[Hague Congress (1872)|Hague Congress]], where Bakunin and [[James
> Guillaume]] were expelled from the International and its headquarters
> were transferred to New York. In response, the federalist sections
> formed their own International at the [[Anarchist St. Imier
> International|St. Imier Congress]], adopting a revolutionary anarchist
> programme.<ref name=Graham-05>Graham, Robert
> '[http://www.blackrosebooks.net/anarism1.htm ''Anarchism''] (Montreal:
> Black Rose Books 2005) ISBN 1-55164-251-4.</ref>The [[Paris
> Commune]] was a government that briefly ruled Paris from 18 March
> (more formally, from 28 March) to 28 May 1871. The Commune was the
> result of an uprising in Paris after France was defeated in the
> Franco-Prussian War. Anarchists participated actively in the
> establishment of the Paris Commune. They included [[Louise Michel]],
> the Reclus brothers, and [[Eugene Varlin]] (the latter murdered in the
> repression afterwards). As for the reforms initiated by the Commune,
> such as the re-opening of workplaces as co-operatives, anarchists can
> see their ideas of associated labour beginning to be
> realised&nbsp;... Moreover, the Commune's ideas on federation
> obviously reflected the influence of Proudhon on French radical ideas.
> Indeed, the Commune's vision of a communal France based on a
> federation of delegates bound by imperative mandates issued by their
> electors and subject to recall at any moment echoes Bakunin's and
> Proudhon's ideas (Proudhon, like Bakunin, had argued in favour of the
> "implementation of the binding mandate" in 1848&nbsp;... and for
> federation of communes). Thus both economically and politically the
> Paris Commune was heavily influenced by anarchist ideas.<ref>
> </ref> George Woodcock states:
答案 0 :(得分:1)