<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 10, 2010, at 7:44 PM, Igor Sysoev wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Could you define algorithm to find the most specific match for regexes, for<br>example, what is more specific for "/dir/page1.php" - "^/dir/", "\.php$",<br>"page\d+" ?<br><br></span></blockquote>No, but then again Igor you are way smarter then i am. NginX is a fantastic piece of work. Like i said earlier i just skipped that "rule" and more specific matches stuck in my head. how i thought about it&nbsp;</div><div><br></div><div>location ~ "^/upload/\.php$" would be more exact then</div><div>location ~ "\.php$" since more parts are being explicitly matched.&nbsp;</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">--<span class="Apple-converted-space">&nbsp;</span><br>Igor Sysoev<br><a href="http://sysoev.ru/en/">http://sysoev.ru/en/</a></span></blockquote></div><br></body></html>