--- parser3/src/classes/regex.C 2018/01/19 00:27:43 1.12 +++ parser3/src/classes/regex.C 2020/12/15 17:10:29 1.15 @@ -1,7 +1,7 @@ /** @file Parser: @b int parser class. - Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -12,7 +12,7 @@ #include "pa_vint.h" #include "pa_vregex.h" -volatile const char * IDENT_REGEX_C="$Id: regex.C,v 1.12 2018/01/19 00:27:43 moko Exp $"; +volatile const char * IDENT_REGEX_C="$Id: regex.C,v 1.15 2020/12/15 17:10:29 moko Exp $"; // class @@ -30,20 +30,16 @@ DECLARE_CLASS_VAR(regex, new MRegex); // methods static void _create(Request& r, MethodParams& params) { - const String& pattern=params.as_string(0, "regexp must not be code"); - 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"); vregex.set(*aregex); } else { + const String& pattern=params.as_string(0, "regexp must not be code"); vregex.set(r.charsets.source(), &pattern, params.count()>1 ? ¶ms.as_string(1, OPTIONS_MUST_NOT_BE_CODE) : 0); } vregex.compile(); - vregex.study(); }