diff options
Diffstat (limited to 'modules/regex/regex.h')
-rw-r--r-- | modules/regex/regex.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/regex/regex.h b/modules/regex/regex.h index e7221f4070..9296de929f 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -33,10 +33,11 @@ #include "core/object/ref_counted.h" #include "core/string/ustring.h" -#include "core/templates/map.h" +#include "core/templates/rb_map.h" #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); @@ -48,7 +49,7 @@ class RegExMatch : public RefCounted { String subject; Vector<Range> data; - Map<String, int> names; + HashMap<String, int> names; friend class RegEx; @@ -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; |