Skip to content

Commit abf9d68

Browse files
committed
Improve regex demo
1 parent 67a490a commit abf9d68

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

misc/regex/regex.gd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
extends VBoxContainer
22

3-
# Member variables
43
var regex = RegEx.new()
54

5+
func _ready():
6+
$Text.set_text("They asked me \"What's going on \\\"in the manor\\\"?\"")
7+
update_expression($Expression.text)
8+
9+
610
func update_expression(text):
711
regex.compile(text)
812
update_text()
913

14+
1015
func update_text():
1116
for child in $List.get_children():
1217
child.queue_free()
@@ -17,7 +22,3 @@ func update_text():
1722
var label = Label.new()
1823
label.text = result
1924
$List.add_child(label)
20-
21-
func _ready():
22-
$Text.set_text("They asked me \"What's going on \\\"in the manor\\\"?\"")
23-
update_expression($Expression.text)

misc/regex/regex.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[ext_resource path="res://regex.gd" type="Script" id=1]
44

5-
[node name="VBoxContainer" type="VBoxContainer"]
5+
[node name="Regex" type="VBoxContainer"]
66
anchor_right = 1.0
77
anchor_bottom = 1.0
88
margin_left = 14.0

0 commit comments

Comments
 (0)