using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\[\[#(.*)\|(.*)\]\]";
string input = @"<languages/>
<translate>
{{TNT|Unmaintained extension}}
{{ {{TNTN|Extension}}
|name = Agora
|type1 = skin
|type2 =
|status = unmaintained
|hook1 = BeforePageDisplay
|image = 2013-04-22_Agora_detail_screenshot.png
|author = Rob Moen, Trevor Parscal, Munaf Assaf
|description = Adds skin-agnostic styles to MediaWiki
|license = {{ {{TNTN|EL}} |GNUGPL2+}}
|mediawiki = 1.19 - 1.21
|version = 0.0.1
|update = 2013-04-04
|download = {{ {{TNTN|WikimediaDownload}} |Agora}}
|readme = {{git file|action=raw|project=mediawiki/extensions/Agora|file=README|text=README}}
|needs-updatephp = no
|parameters = * $wgAgoraEnabledSiteWide
* $wgAgoraEnabledPages
* $wgAgoraEnabledActions
|example =
}}
The '''Agora''' extension added skin-agnostic CSS styles to MediaWiki,
following the [[Special:MyLanguage/Wikimedia Foundation Design|Wikimedia Foundation Design]] principles.
The CSS defines various mw-ui-* classes including
* <code>.mw.ui-button</code> with many variations
* <code>.mw-ui-vform</code> for a container with a vertical ""stacked"" layout
* several utility classes such as <code>mw-ui-flush-left</code>
Its test subdirectory has some static HTML pages illustrating their use.
== Also in 1.22 core ==
As of {{gerrit|55847}}, the same CSS is available in core MediaWiki in release 1.22wmf2 in the [[Special:MyLanguage/ResourceLoader/Default_modules#mediawiki.ui|mediawiki.ui]] module, and you don't need this extension. In release 1.23, the CSS for buttons is split out into a [[Special:MyLanguage/ResourceLoader/Default_modules#mediawiki.ui.button|mediawiki.ui.button]] module.
Thus you can use ''context''<code>->getOutput()->addModuleStyles( 'mediawiki.ui' )</code> to ensure the CSS in core is loaded.
==Installation==
{{TNT|ExtensionInstall}}
Consult its README file to decide how to enable the extension in pages on your wiki and set its globals accordingly in LocalSettings.php
=== Verifying the installation ===
On a page where the extension should provide its CSS according to your configuration, create a submit button and give it the styles 'mw-ui-button blue'.
To see if the extension is sent down on the current page, in a browser console enter <kbd>mw.loader.state( 'ext.agora.base' )</kbd>; it should return ""ready"".
=== Compass ===
The extension's CSS was generated from [[w:Sass (stylesheet language)|Sass]] <tt>.sccs</tt> files using [http://compass-style.org/ Compass].
You don't need Compass to use the CSS files in <tt>modules/css</tt>. Click [[#Installation|installation]].
[[Category:Agora{{translation}}|Category:Agora{{translation}}]]
</translate>";
RegexOptions options = RegexOptions.IgnoreCase;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx