Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add string.escapepattern function #737

Merged
merged 2 commits into from Apr 10, 2017
Merged

Add string.escapepattern function #737

merged 2 commits into from Apr 10, 2017

Conversation

ghost
Copy link

@ghost ghost commented Apr 10, 2017

Using filenames with string.match and string.find, etc. is problematic because they take Lua patterns as an argument where ( ) . % + - * ? [ ] ^ $ are special characters.

This pull request adds a string.escapepattern function that escapes strings to be used with patterns.

Copy link
Member

@samsinsane samsinsane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add tests for this, not only for positive cases but also some negative cases.

@starkos starkos merged commit 00f6f05 into premake:master Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants