|
|
| version 1.151, 2007/02/03 18:08:38 | version 1.152, 2007/04/20 10:19:24 |
|---|---|
| Line 336 static void _match(Request& r, MethodPar | Line 336 static void _match(Request& r, MethodPar |
| Temp_lang temp_lang(r, String::L_PASS_APPENDED); | Temp_lang temp_lang(r, String::L_PASS_APPENDED); |
| const String& src=GET_SELF(r, VString).string(); | const String& src=GET_SELF(r, VString).string(); |
| bool just_matched; | int matches_count=0; |
| if(params.count()<3) { // search | if(params.count()<3) { // search |
| Table* table=src.match(r.charsets.source(), | Table* table=src.match(r.charsets.source(), |
| regexp.as_string(), options, | regexp.as_string(), options, |
| search_action, 0, | search_action, 0, |
| just_matched); | matches_count); |
| // Value* result; | // r.write_assign_lang(*new VTable(table)); |
| // if(table) | if(table){ |
| // result=new VTable(table); // table of pre/match/post+substrings | |
| // else | |
| // result=new VBool(just_matched); | |
| // r.write_assign_lang(*result); | |
| r.write_assign_lang(*new VTable(table)); | r.write_assign_lang(*new VTable(table)); |
| } else { | |
| r.write_assign_lang(*new VInt(matches_count)); | |
| } | |
| } else { // replace | } else { // replace |
| Value& replacement_code=params.as_junction(2, "replacement param must be code"); | Value& replacement_code=params.as_junction(2, "replacement param must be code"); |
| Line 367 static void _match(Request& r, MethodPar | Line 367 static void _match(Request& r, MethodPar |
| src.match(r.charsets.source(), | src.match(r.charsets.source(), |
| r.process_to_string(regexp), options, | r.process_to_string(regexp), options, |
| replace_action, &info, | replace_action, &info, |
| just_matched); | matches_count); |
| r.write_assign_lang(result); | r.write_assign_lang(result); |
| } | } |
| } | } |