class_regexmatch.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the RegExMatch.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_RegExMatch:
  5. RegExMatch
  6. ==========
  7. **Inherits:** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Contains the results of a regex search.
  12. Member Functions
  13. ----------------
  14. +------------------------------+-------------------------------------------------------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`get_end<class_RegExMatch_get_end>` **(** :ref:`Variant<class_variant>` name=0 **)** const |
  16. +------------------------------+-------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_group_count<class_RegExMatch_get_group_count>` **(** **)** const |
  18. +------------------------------+-------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`get_start<class_RegExMatch_get_start>` **(** :ref:`Variant<class_variant>` name=0 **)** const |
  20. +------------------------------+-------------------------------------------------------------------------------------------------------+
  21. | :ref:`String<class_string>` | :ref:`get_string<class_RegExMatch_get_string>` **(** :ref:`Variant<class_variant>` name=0 **)** const |
  22. +------------------------------+-------------------------------------------------------------------------------------------------------+
  23. Member Variables
  24. ----------------
  25. .. _class_RegExMatch_names:
  26. - :ref:`Dictionary<class_dictionary>` **names** - A dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one.
  27. .. _class_RegExMatch_strings:
  28. - :ref:`Array<class_array>` **strings** - An :ref:`Array<class_array>` of the match and its capturing groups.
  29. .. _class_RegExMatch_subject:
  30. - :ref:`String<class_string>` **subject** - The source string used with the search pattern to find this matching result.
  31. Description
  32. -----------
  33. Contains the results of a single regex match returned by :ref:`RegEx.search<class_RegEx_search>` and :ref:`RegEx.search_all<class_RegEx_search_all>`. It can be used to find the position and range of the match and its capturing groups, and it can extract its sub-string for you.
  34. Member Function Description
  35. ---------------------------
  36. .. _class_RegExMatch_get_end:
  37. - :ref:`int<class_int>` **get_end** **(** :ref:`Variant<class_variant>` name=0 **)** const
  38. Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern.
  39. Returns -1 if the group did not match or doesn't exist.
  40. .. _class_RegExMatch_get_group_count:
  41. - :ref:`int<class_int>` **get_group_count** **(** **)** const
  42. Returns the number of capturing groups.
  43. .. _class_RegExMatch_get_start:
  44. - :ref:`int<class_int>` **get_start** **(** :ref:`Variant<class_variant>` name=0 **)** const
  45. Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern.
  46. Returns -1 if the group did not match or doesn't exist.
  47. .. _class_RegExMatch_get_string:
  48. - :ref:`String<class_string>` **get_string** **(** :ref:`Variant<class_variant>` name=0 **)** const
  49. Returns the substring of the match from the source string. Capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern.
  50. Returns an empty string if the group did not match or doesn't exist.