Wikipedia talk:AutoWikiBrowser/Settings/Bracket reference conversion

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Alternative search and replace[edit]

I have had more success with the following search string:

"(?<!(<ref.*>|\*\s*))\[(https?://[^\] ]*)\](?!.*</ref>)"

This will find all inline URLs "\[(https?://[^\] ]*)\]" that are not already inside a footnote reference or immediately following an asterisk. This avoids many false positives.

I then use a replace string as follows:

"<ref>$2</ref>"

Gaius Cornelius 15:12, 4 December 2006 (UTC)