regex.tscn 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. [gd_scene load_steps=2 format=3 uid="uid://cimp70l7c0y2p"]
  2. [ext_resource type="Script" path="res://regex.gd" id="1"]
  3. [node name="Regex" type="VBoxContainer"]
  4. anchors_preset = 15
  5. anchor_right = 1.0
  6. anchor_bottom = 1.0
  7. offset_left = 14.0
  8. offset_top = 20.0
  9. offset_right = -14.0
  10. offset_bottom = -20.0
  11. grow_horizontal = 2
  12. grow_vertical = 2
  13. theme_override_constants/separation = 10
  14. script = ExtResource("1")
  15. [node name="Help" type="RichTextLabel" parent="."]
  16. modulate = Color(1, 1, 1, 0.752941)
  17. custom_minimum_size = Vector2(0, 50)
  18. layout_mode = 2
  19. bbcode_enabled = true
  20. text = "Regular expressions (RegEx) can be used for advanced text matching.
  21. You can use [url=https://regexr.com]RegExr[/url] to test regular expressions online and compare results."
  22. [node name="HBoxContainer" type="HBoxContainer" parent="."]
  23. layout_mode = 2
  24. theme_override_constants/separation = 10
  25. [node name="Label" type="Label" parent="HBoxContainer"]
  26. layout_mode = 2
  27. size_flags_horizontal = 3
  28. size_flags_vertical = 5
  29. size_flags_stretch_ratio = 0.08
  30. text = "RegEx"
  31. horizontal_alignment = 2
  32. [node name="Expression" type="LineEdit" parent="HBoxContainer"]
  33. unique_name_in_owner = true
  34. layout_mode = 2
  35. size_flags_horizontal = 3
  36. text = "\"((?:\\\\.|[^\"])*)\""
  37. placeholder_text = "Regular expression to match against"
  38. [node name="HBoxContainer2" type="HBoxContainer" parent="."]
  39. layout_mode = 2
  40. theme_override_constants/separation = 10
  41. [node name="Label" type="Label" parent="HBoxContainer2"]
  42. layout_mode = 2
  43. size_flags_horizontal = 3
  44. size_flags_vertical = 5
  45. size_flags_stretch_ratio = 0.08
  46. text = "Text"
  47. horizontal_alignment = 2
  48. [node name="Text" type="TextEdit" parent="HBoxContainer2"]
  49. unique_name_in_owner = true
  50. custom_minimum_size = Vector2(0, 200)
  51. layout_mode = 2
  52. size_flags_horizontal = 3
  53. placeholder_text = "Text to search in"
  54. [node name="ScrollContainer" type="ScrollContainer" parent="."]
  55. layout_mode = 2
  56. size_flags_vertical = 3
  57. [node name="List" type="VBoxContainer" parent="ScrollContainer"]
  58. unique_name_in_owner = true
  59. layout_mode = 2
  60. [connection signal="meta_clicked" from="Help" to="." method="_on_help_meta_clicked"]
  61. [connection signal="text_changed" from="HBoxContainer/Expression" to="." method="update_expression"]
  62. [connection signal="text_changed" from="HBoxContainer2/Text" to="." method="update_text"]