I need to implement something similar to wikilinks on my site. The user enters plain text and enters [[asdf]] wherever there is an internal link. Only the first five examples are really applicable in the implementation that I need.
Is it possible to use a regular expression, which expression will do this? Is there a library somewhere that already does this in C #?
On the pure regex side, the expression would rather be:
\[\[([^\]\|\r\n]+?)\|([^\]\|\r\n]+?)\]\]([^\] ]\S*) \[\[([^\]\|\r\n]+?)\]\]([^\] ]\S*)
(.+?) ([^\]\|\r\n]+?), , .
(.+?)
([^\]\|\r\n]+?)
([^\] ]\S+) , wiki .
([^\] ]\S+)
, #, .
, , pushdown automaton # regexp,
, , , :
\[\[(.+?)\|(.+?)\]\](\S+)
<a href="\2">\1\3</a>
\[\[(.+?)\]\](\S+)
<a href="\1">\1\2</a>
- .
, , - . , 90% , , , :
string html = "Some text with a wiki style [[page2.html|link]]"; html = Regex.Replace(html, @"\[\[([^\]\|\r\n]+?)\|([^\]\|\r\n]+?)\]\]([^\] ]\S*)", @"<a href=""$1"">$2$3</a>"); html = Regex.Replace(html, @"\[\[([^\]\|\r\n]+?)\]\]([^\] ]\S*)", @"<a href=""$1"">$1$2</a>");
- , , href , . .
Source: https://habr.com/ru/post/1702222/More articles:Logging IP addresses for multiple models in an existing application - ruby-on-railsThe main question is OCAML OOP - oopWhy is there a queue in C # that scrambles data in its elements? - multithreadingCreating a cell in JTable for editing - the default value of the cell is javaThe easiest way to create a tiny Linux database application - databaseEntering a recommendation to a recursive method in Spring.Net? - c #How to get Visual Web Developer to use IIS and not ASP.NET development server? - asp.netHow to find out if you are connected to the Internet - c #Проблемы с запуском приложения ASP.NET с IIS - asp.netDynamic naming of PHP objects - phpAll Articles