%1 string pattern not recognized by script editor

Reproduction Steps
On the latest version of studio, the script editor does not recognize %1 as being a valid string pattern

Expected Behavior
The script editor to recognize %1 as being a pattern

Actual Behavior
The script editor does not recognize %1 as being a pattern

Issue Area: Studio
Issue Type: Display
Impact: Low
Frequency: Constantly

It’s not a fix, but for what it’s worth to those reading this, the warning is suppressed when you use a capture group:
image

Please use %0 if you need to refer to the entire string. While Lua 5.1 allows %1 as a special case to refer to the entire string when the pattern doesn’t have captures, it can be error prone when referring to the capture was desired instead, so our linter warns on this.

5 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.