<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 27, 2015, at 12:10 PM, Chengyu Fan <<a href="mailto:chengy.fan@gmail.com" class="">chengy.fan@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">I'm trying to use the validator-regex to validate the incoming data, but I stuck at how to add the SecRuleRelative Rule.</div><div class=""><br class=""></div>Can somebody tell me some clues?<div class=""><br class=""><div class="">Specifically, I find the example in SecurityLibrary(<a href="http://redmine.named-data.net/projects/ndn-cxx/wiki/SecurityLibrary" class="">http://redmine.named-data.net/projects/ndn-cxx/wiki/SecurityLibrary</a>), but I don't understand the RuleRelative rule below ...</div><div class=""><pre style="padding:6px 10px;border-radius:3px;margin-right:1em;margin-left:1.6em;border:1px solid rgb(226,226,226);width:auto;color:rgb(72,72,72);font-size:12px;background-color:rgb(250,250,250)" class=""><code class="">SecRuleRelative rule(<span class=""><span class="" style="color:rgb(68,102,170)">"</span><span class="" style="color:rgb(68,102,170)">^(<>*)$</span><span class="" style="color:rgb(68,102,170)">"</span></span>, <span class=""><span class="" style="color:rgb(68,102,170)">"</span><span class="" style="color:rgb(68,102,170)">^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$</span><span class="" style="color:rgb(68,102,170)">"</span></span>, 
                     <span class=""><span class="" style="color:rgb(68,102,170)">"</span><span class="" style="color:rgb(68,102,170)">></span><span class="" style="color:rgb(68,102,170)">"</span></span>, <span class=""><span class="" style="color:rgb(68,102,170)">"</span><span class="" style="color:rgb(68,102,170)">\\</span><span class="" style="color:rgb(68,102,170)">1</span><span class="" style="color:rgb(68,102,170)">"</span></span>, <span class=""><span class="" style="color:rgb(68,102,170)">"</span><span class="" style="color:rgb(68,102,170)">\\</span><span class="" style="color:rgb(68,102,170)">1</span><span class="" style="color:rgb(68,102,170)">\\</span><span class="" style="color:rgb(68,102,170)">2</span><span class="" style="color:rgb(68,102,170)">"</span></span>, <span class="" style="color:rgb(0,102,153)">true</span>);
</code>
</pre><div class="">What's the meaning of <span class="" style="color:rgb(72,72,72);font-size:12px;background-color:rgb(250,250,250)"><span class="" style="color:rgb(68,102,170)">"</span><span class="" style="color:rgb(68,102,170)">></span><span class="" style="color:rgb(68,102,170)">"</span></span><span style="color:rgb(72,72,72);font-size:12px;background-color:rgb(250,250,250)" class="">, </span><span class="" style="color:rgb(72,72,72);font-size:12px;background-color:rgb(250,250,250)"><span class="" style="color:rgb(68,102,170)">"</span><span class="" style="color:rgb(68,102,170)">\\</span><span class="" style="color:rgb(68,102,170)">1</span><span class="" style="color:rgb(68,102,170)">"</span></span><span style="color:rgb(72,72,72);font-size:12px;background-color:rgb(250,250,250)" class="">, </span><span class="" style="color:rgb(72,72,72);font-size:12px;background-color:rgb(250,250,250)"><span class="" style="color:rgb(68,102,170)">"</span><span class="" style="color:rgb(68,102,170)">\\</span><span class="" style="color:rgb(68,102,170)">1</span><span class="" style="color:rgb(68,102,170)">\\</span><span class="" style="color:rgb(68,102,170)">2</span><span class="" style="color:rgb(68,102,170)">" </span></span>? Can someone give me an example?</div></div></div></div></div></blockquote><br class=""></div><div>This is just a regular expression rules.  <a href="smb://1" class="">\\1</a> (\1, it’s just \ needs to be escaped in c++) refer to th first group of the regular expression, <a href="smb://2" class="">\\2</a> refer to the second group, etc.</div><div><br class=""></div><div>There are many documentation sources about regexps, e.g., <a href="http://www.boost.org/doc/libs/1_57_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html" class="">http://www.boost.org/doc/libs/1_57_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html</a>.</div><div><br class=""></div><div>The only difference in our regular expressions is the fact that it is defined over name components, not just strings.  There is a documentation for this at <a href="http://named-data.net/doc/ndn-cxx/current/tutorials/utils-ndn-regex.html" class="">http://named-data.net/doc/ndn-cxx/current/tutorials/utils-ndn-regex.html</a></div><div><br class=""></div><div>—</div><div>Alex</div><div><br class=""></div><br class=""></body></html>