Rob Hooft wrote:
Timwi wrote:
Redirects are ridiculously easy to parse with a
regular expression.
Don't forget that the "#redirect" string can be translated, and is
translated in the cy: wikipedia to "#ail-cyfeirio". The regular
expression is a little more complicated than you might think at first
sight....
Not really. As far as I understand it, all redirects satisfy
/^\s*#\S+\s*:?\s*\[\[([^\]]+)\]\]\s*$/s.
Obviously I'm aware that this can catch non-redirects, but it would have
to be a really weird article, and in fact one that probably should be a
redirect anyway.
Timwi