diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-08-02 18:16:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-02 18:16:04 +0200 |
commit | c67febb008675fff6ebbac40d3a0565f937f2f8c (patch) | |
tree | 08f486732447b867847bdffe2edb9df191c3b462 /modules/regex/regex.h | |
parent | 47be80905c2ffe8fcc7e33d1cffb9685bb461929 (diff) | |
parent | 61a2cb65b1338cd6ac02500f6c8f7da21e858c6f (diff) | |
download | redot-engine-c67febb008675fff6ebbac40d3a0565f937f2f8c.tar.gz |
Merge pull request #63830 from KoBeWi/regEX
Add static method for creating RegEx
Diffstat (limited to 'modules/regex/regex.h')
-rw-r--r-- | modules/regex/regex.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/regex/regex.h b/modules/regex/regex.h index 1455188670..9296de929f 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -37,6 +37,7 @@ #include "core/templates/vector.h" #include "core/variant/array.h" #include "core/variant/dictionary.h" +#include "core/variant/typed_array.h" class RegExMatch : public RefCounted { GDCLASS(RegExMatch, RefCounted); @@ -81,11 +82,13 @@ protected: static void _bind_methods(); public: + static Ref<RegEx> create_from_string(const String &p_pattern); + void clear(); Error compile(const String &p_pattern); Ref<RegExMatch> search(const String &p_subject, int p_offset = 0, int p_end = -1) const; - Array search_all(const String &p_subject, int p_offset = 0, int p_end = -1) const; + TypedArray<RegExMatch> search_all(const String &p_subject, int p_offset = 0, int p_end = -1) const; String sub(const String &p_subject, const String &p_replacement, bool p_all = false, int p_offset = 0, int p_end = -1) const; bool is_valid() const; |