--- parser3/src/classes/regex.C 2018/01/19 00:31:18 1.13 +++ parser3/src/classes/regex.C 2026/04/25 13:38:46 1.19 @@ -1,8 +1,8 @@ /** @file Parser: @b int parser class. - Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" @@ -12,7 +12,7 @@ #include "pa_vint.h" #include "pa_vregex.h" -volatile const char * IDENT_REGEX_C="$Id: regex.C,v 1.13 2018/01/19 00:31:18 moko Exp $"; +volatile const char * IDENT_REGEX_C="$Id: regex.C,v 1.19 2026/04/25 13:38:46 moko Exp $"; // class @@ -32,9 +32,7 @@ DECLARE_CLASS_VAR(regex, new MRegex); static void _create(Request& r, MethodParams& params) { VRegex& vregex=GET_SELF(r, VRegex); - if(VRegex* aregex = static_cast(params[0].as(VREGEX_TYPE))){ - if(params.count()>1) - throw Exception(PARSER_RUNTIME, 0, "options can't be specified"); + if(VRegex* aregex = dynamic_cast(¶ms[0])){ vregex.set(*aregex); } else { const String& pattern=params.as_string(0, "regexp must not be code");