Template:Lua escape/doc
Appearance
| This is a documentation subpage for Template:Lua escape. It may contain usage information, categories and other content that is not part of the original template page. |
__EXPECTED_UNCONNECTED_PAGE__
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
- Template:Template usage#Metacharacters
- mw:Extension:Scribunto/Lua reference manual#Patterns
- mw:Extension:ReplaceSet – what we really need, but don't have
Notes
Cite error: <ref> tags exist for a group named "lower-alpha", but no corresponding <references group="lower-alpha"/> tag was found