/*************************************************/ /* regex.cpp */ /*************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ /* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ #include "regex.h" #include "nrex.hpp" #include "core/os/memory.h" void RegEx::_bind_methods() { ObjectTypeDB::bind_method(_MD("compile","pattern", "expanded"),&RegEx::compile, DEFVAL(true)); ObjectTypeDB::bind_method(_MD("find","text","start","end"),&RegEx::find, DEFVAL(0), DEFVAL(-1)); ObjectTypeDB::bind_method(_MD("clear"),&RegEx::clear); ObjectTypeDB::bind_method(_MD("is_valid"),&RegEx::is_valid); ObjectTypeDB::bind_method(_MD("get_capture_count"),&RegEx::get_capture_count); ObjectTypeDB::bind_method(_MD("get_capture","capture"),&RegEx::get_capture); ObjectTypeDB::bind_method(_MD("get_captures"),&RegEx::_bind_get_captures); }; StringArray RegEx::_bind_get_captures() const { StringArray ret; int count = get_capture_count(); for (int i=0; i