/**************************************************************************/ /* regex.cpp */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /**************************************************************************/ /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #include "regex.h" #include "regex.compat.inc" #include "core/os/memory.h" extern "C" { #include <pcre2.h> } static void *_regex_malloc(PCRE2_SIZE size, void *user) { … } static void _regex_free(void *ptr, void *user) { … } int RegExMatch::_find(const Variant &p_name) const { … } String RegExMatch::get_subject() const { … } int RegExMatch::get_group_count() const { … } Dictionary RegExMatch::get_names() const { … } PackedStringArray RegExMatch::get_strings() const { … } String RegExMatch::get_string(const Variant &p_name) const { … } int RegExMatch::get_start(const Variant &p_name) const { … } int RegExMatch::get_end(const Variant &p_name) const { … } void RegExMatch::_bind_methods() { … } void RegEx::_pattern_info(uint32_t what, void *where) const { … } Ref<RegEx> RegEx::create_from_string(const String &p_pattern, bool p_show_error) { … } void RegEx::clear() { … } Error RegEx::compile(const String &p_pattern, bool p_show_error) { … } Ref<RegExMatch> RegEx::search(const String &p_subject, int p_offset, int p_end) const { … } TypedArray<RegExMatch> RegEx::search_all(const String &p_subject, int p_offset, int p_end) const { … } String RegEx::sub(const String &p_subject, const String &p_replacement, bool p_all, int p_offset, int p_end) const { … } bool RegEx::is_valid() const { … } String RegEx::get_pattern() const { … } int RegEx::get_group_count() const { … } PackedStringArray RegEx::get_names() const { … } RegEx::RegEx() { … } RegEx::RegEx(const String &p_pattern) { … } RegEx::~RegEx() { … } void RegEx::_bind_methods() { … }