|
|
| version 1.59, 2001/07/07 16:38:01 | version 1.60, 2001/07/09 16:13:17 |
|---|---|
| Line 200 static void _match(Request& r, const Str | Line 200 static void _match(Request& r, const Str |
| Temp_lang temp_lang(r, String::UL_PASS_APPENDED); | Temp_lang temp_lang(r, String::UL_PASS_APPENDED); |
| Table *table; | Table *table; |
| if(params->size()<3) { // search | if(params->size()<3) { // search |
| if(src.match(r.pcre_tables, | bool matched=src.match(r.pcre_tables, |
| &method_name, | &method_name, |
| regexp.as_string(), options, | regexp.as_string(), options, |
| &table, | &table, |
| search_action, 0)) { | search_action, 0); |
| // matched | // matched |
| if(table->columns()->size()==3 && // just matched[3=pre/match/post], no substrings | if(table->columns()->size()==3 && // just matched[3=pre/match/post], no substrings |
| table->size()==1) // just one row, not /g_lobal search | table->size()<=1) // just one row, not /g_lobal search |
| result=new(pool) VBool(pool, true); | result=new(pool) VBool(pool, matched); |
| else // table of pre/match/post+substrings | else // table of pre/match/post+substrings |
| result=new(pool) VTable(pool, table); | result=new(pool) VTable(pool, table); |
| } else // not matched [not global] | |
| result=new(pool) VBool(pool, false); | |
| } else { // replace | } else { // replace |
| Value& replacement_code=params->as_junction(2, "replacement code must be code"); | Value& replacement_code=params->as_junction(2, "replacement code must be code"); |