Jump to content

Template:Lua escape

From Elite Dangerous Wiki
Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit "Template:Lua escape/doc" to edit its documentation if it is available. (How does this work?)

Escapes a string to make it suitable as a Lua Scribunto regular expression.

The full set of metacharacters needing escaping in patterns is: ().%+-*?[^$; for now, only hyphen is escaped.[lower-alpha 1]

Usage

{{Lua escape|string}}

Parameters

There is one required positional parameter:

|1= – the string to be escaped

Examples

  • {{Lua escape|uw-vandalism4}} → uw%-vandalism4
  • {{Lua escape|Template:Please see}} → Template:Please see
  • {{Lua escape|Template:Uw-c&pmove}} → Template:Uw%-c&pmove
  • {{Lua escape|Template:A&E original programming}} → Template:A&E original programming
  • {{Lua escape|Template:D&D-stub}} → Template:D&D%-stub
  • {{Lua escape|Template:Welcome v2.0}} → Template:Welcome v2.0     (fails to escape the dot)

See also

Notes


Cite error: <ref> tags exist for a group named "lower-alpha", but no corresponding <references group="lower-alpha"/> tag was found