Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^ *load[(] *(['"])(?<path>(?:[^\n'"]+|.(?<!\1))+)(\1) *[)]
/
gm

Description

Loose matching of load statements, capturing the path parameter in the path capture group.

load('./scene.tscn')
load('path/to/resource.tres')
load("path/to/file.gd")
Submitted by disk0__ - 3 years ago