mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
classref: Sync with current master branch
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
RegEx
|
||||
=====
|
||||
|
||||
**Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
|
||||
**Inherits:** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
|
||||
|
||||
**Category:** Core
|
||||
|
||||
@@ -18,28 +18,23 @@ Simple regular expression matcher.
|
||||
Member Functions
|
||||
----------------
|
||||
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear<class_RegEx_clear>` **(** **)** |
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`compile<class_RegEx_compile>` **(** :ref:`String<class_string>` pattern **)** |
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_group_count<class_RegEx_get_group_count>` **(** **)** const |
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_array>` | :ref:`get_names<class_RegEx_get_names>` **(** **)** const |
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_string>` | :ref:`get_pattern<class_RegEx_get_pattern>` **(** **)** const |
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_valid<class_RegEx_is_valid>` **(** **)** const |
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`RegExMatch<class_regexmatch>` | :ref:`search<class_RegEx_search>` **(** :ref:`String<class_string>` text, :ref:`int<class_int>` start=0, :ref:`int<class_int>` end=-1 **)** const |
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_string>` | :ref:`sub<class_RegEx_sub>` **(** :ref:`String<class_string>` text, :ref:`String<class_string>` replacement, :ref:`bool<class_bool>` all=false, :ref:`int<class_int>` start=0, :ref:`int<class_int>` end=-1 **)** const |
|
||||
+--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Member Variables
|
||||
----------------
|
||||
|
||||
- :ref:`String<class_string>` **pattern**
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear<class_RegEx_clear>` **(** **)** |
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`compile<class_RegEx_compile>` **(** :ref:`String<class_string>` pattern **)** |
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_group_count<class_RegEx_get_group_count>` **(** **)** const |
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_array>` | :ref:`get_names<class_RegEx_get_names>` **(** **)** const |
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_string>` | :ref:`get_pattern<class_RegEx_get_pattern>` **(** **)** const |
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_valid<class_RegEx_is_valid>` **(** **)** const |
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`RegExMatch<class_regexmatch>` | :ref:`search<class_RegEx_search>` **(** :ref:`String<class_string>` subject, :ref:`int<class_int>` offset=0, :ref:`int<class_int>` end=null **)** const |
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_string>` | :ref:`sub<class_RegEx_sub>` **(** :ref:`String<class_string>` subject, :ref:`String<class_string>` replacement, :ref:`bool<class_bool>` all=false, :ref:`int<class_int>` offset=null, :ref:`int<class_int>` end=null **)** const |
|
||||
+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Description
|
||||
-----------
|
||||
@@ -133,13 +128,13 @@ Returns whether this object has a valid regular expression assigned.
|
||||
|
||||
.. _class_RegEx_search:
|
||||
|
||||
- :ref:`RegExMatch<class_regexmatch>` **search** **(** :ref:`String<class_string>` text, :ref:`int<class_int>` start=0, :ref:`int<class_int>` end=-1 **)** const
|
||||
- :ref:`RegExMatch<class_regexmatch>` **search** **(** :ref:`String<class_string>` subject, :ref:`int<class_int>` offset=0, :ref:`int<class_int>` end=null **)** const
|
||||
|
||||
Searches the text for the compiled pattern. Returns a :ref:`RegExMatch<class_regexmatch>` container of the first matching reult if found, otherwise null. The region to search within can be specified without modifying where the start and end anchor would be.
|
||||
|
||||
.. _class_RegEx_sub:
|
||||
|
||||
- :ref:`String<class_string>` **sub** **(** :ref:`String<class_string>` text, :ref:`String<class_string>` replacement, :ref:`bool<class_bool>` all=false, :ref:`int<class_int>` start=0, :ref:`int<class_int>` end=-1 **)** const
|
||||
- :ref:`String<class_string>` **sub** **(** :ref:`String<class_string>` subject, :ref:`String<class_string>` replacement, :ref:`bool<class_bool>` all=false, :ref:`int<class_int>` offset=null, :ref:`int<class_int>` end=null **)** const
|
||||
|
||||
Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as ``\1`` and ``\g<name>`` expanded and resolved. By default only the first instance is replaced but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user