Project

General

Profile

Feature #2828

Updated by Qiuhan Ding almost 9 years ago

Add Pattern Inference in NDN Regular Expression to support new trust schema. 

 **Pattern Inference** is to derive patterns of original regex pattern with additional knowledge. Basically, we pass a list of arguments names to regex, the number of which will be equal to the number of back references in the original pattern. Then the regex will match its back reference with these arguments names and update the regex. New pattern derived from the updated regex will get all its back references filled.  

 There are three possible types of arguments: name, "null" or "NA" (case insensitive for the last two). name will replace the sub group with a new pattern, "null" will remove the sub group. "NA" will leave the sub group as it is. 

 For example: If originally I have a pattern like:  

 `<ndn><ucla>(<>)<>*` 

 `<ndn><ucla>(<>)(<>*)` 

 And I should pass a vector with two elements.  
 The one element, such as Name("/qiuhan") and the return of vector ["/qiuhan", "/mac/temp"] would be 

 `<ndn><ucla><qiuhan><mac><temp>` 

 The return of vector ["/qiuhan", "NA"] would be 

 `<ndn><ucla><qiuhan>(<>*)` 

 The return of vector ["/qiuhan", "null"] would be 

 `<ndn><ucla><qiuhan>` 

  

 `<ndn><ucla><qiuhan><>*`

Back