Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-02-13 02:16
Flavor·JavaScript

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

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__