Computational Mathematics

Adventures in Computing, Statistics, and R

Wiki Markup Link Parser

Comments Off

A PHP script that takes Wiki markup (the markup used on Wikipedia and other Mediawiki sites) and extracts the name of all internal links in a list. Any disambiguation is removed as well.

Sample input:

* [[Baseball]]
*”[[Italics]]
* [[R (programming language)]]
* [[Probability density function|PDF]]

Sample output:

Baseball
Italics
R
PDF

Regular expression used to match [[internal link]] list markup: /\*['\s]{1,2}?\[\[(.+?)\]\]/

Script: http://www.compmath.com/files/wikilinks.php
Source: https://github.com/jon-lee/Wiki-Markup-Link-Parser

Comments are closed.