Search script source
script_grepSearch Luau source to find where a symbol or pattern occurs, returning paths and line numbers. Locate code to edit without reading whole scripts.
Instructions
Searches inside Luau source across the place and returns matching lines with their paths and line numbers.
Use this to find where something is defined or used before editing it — it is far cheaper than reading whole scripts to look for one call.
Patterns are Lua patterns, which are not regular expressions: % escapes instead of backslash, there is no alternation, and - means a lazy quantifier. Set literal to search for text exactly as written, which is usually what you want for identifiers.
Matches come from the script editor's live buffer, so unsaved edits are searched too.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Limit to this subtree, e.g. "ServerScriptService". Omit to search everywhere. | |
| limit | No | Maximum items to return (1-500). | |
| cursor | No | Opaque cursor from a previous call's `nextCursor`. Omit for the first page. | |
| literal | No | Treat `pattern` as plain text rather than a Lua pattern. | |
| pattern | Yes | Lua pattern, or exact text when `literal` is set, e.g. "PlayerAdded". | |
| studioId | No | Target Studio; omit for the active one. | |
| className | No | Restrict to one script class: "Script", "LocalScript" or "ModuleScript". | |
| ignoreCase | No | Case-insensitive. Both sides are lowercased, so pattern classes like %u stop being meaningful — combine with `literal`. | |
| contextLines | No | Lines of context to show either side of each match. |