This template takes a comma-separated string of names and looks for aliases that are set off by a forward slash ("/"), such as Dale Henson/slade. If found, the names are formatted like so: Dale Henson (as slade). Either name (or both) may be wikilinked.

The regular expression %([\w\.[:space:]\[\]]+)\/([\w\.[:space:]\[\]]+)% is essentially two identical capture groups separated by a forward slash. The symbols used are as follows:

  • % - delimits the start and end of the regex.
  • (…) - defines a capture group inside the parentheses.
  • \w - matches any word character, A through Z, 0 through 9, and the underscore, case insensitive.
  • \. - matches the period punctuation symbol.
  • [:space:] - matches the space or the tab character.
  • \[ - matches the left square bracket.
  • \] - matches the right square bracket.
  • […]+ - matches one or more of any characters in the bracketed list.

The regex find/replace is performed by the regex parser function:

{{#regex:{{{1|}}}|%([\w\.[:space:]\[\]]+)\/([\w\.[:space:]\[\]]+)%|$1 (as $2)}}

Where

  • $1 - gets replaced with the first capture group.
  • $2 - gets replaced with the second capture group.
Community content is available under CC-BY-SA unless otherwise noted.