Skip to content

string.escapepattern

starkos edited this page Apr 10, 2021 · 3 revisions

⚠️ We have a new website! Visit now for the most update to date documentation.
       This wiki is no longer being maintained.


Escapes the string for use in Lua patterns. Escapes the following characters ( ) . % + - * ? [ ] ^ $ with %.

escaped = string.escapepattern("s")

Parameters

s is the string to escape.

Return Value

Returns the input string escaped for use in Lua patterns.

Examples

local match = filename:match(string.escapepattern("boost_filesystem-vc140.1.61.0.0"))

Availability

Premake 5.0 or later.

Clone this wiki locally