关于IIS 伪静态 URL重写的正则匹配问题.
服务器环境, windows 2012, urlrewrite2, web.config
URL:
1). articles-a12345.html
2). articles-v12345.html
3). articles-a1234567.html
4). articles-v1234567.html
如果正则是:
articles\-(\w+)\.html$
即:
......
<rule name="articles">
<match url="articles\-(\w+)\.html$" />
<action type="Rewrite" url="/view/?id={R:1}" />
</rule>
...
则 1) 2) 3) 4) 全部匹配了,
如果我只想匹配 1) 和 2),正则如何来写啊? 也就是长度为 6 ( "a12345" 是六个字符 )
如果我想匹配 长度为 6到9 ( "axxxxxx " 长度为 6,7,8,9 ) 又该如何写啊?