注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

itoedr的it学苑

记录从IT文盲学到专家的历程

 
 
 

日志

 
 

ATS -linuxbox正则表达式规则  

2013-07-17 16:00:05|  分类: ATS-linuxbox |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

***********************************
一则ATS正则表达式:regex_map http://(.*) http://$1 #表示全部代理转发所有80号应用。
***********************************
Specifying URL regular expressions (url_regex)



Entries of type url_regex within the configuration files use regular expressions to perform a match.
The following table offers examples to illustrate how to create a valid url_regex.

Value

Description

x

Matches the character x.

.

Match any character.

^

Specifies beginning of line.

$

Specifies end of line.

[xyz]

A character class. In this case, the pattern matches either x, y, or z.

[abj-oZ]

A character class with a range. This pattern matches a, b, any letter from j through o, or Z.

[^A-Z]

A negated character class. For example, this pattern matches any character except those in the class.

r*

Zero or more r's, where r is any regular expression.

r+

One or more r's, where r is any regular expression.

r?

Zero or one r, where r is any regular expression.

r{2,5}

From two to five r's, where r is any regular expression.

r{2,}

Two or more r's, where r is any regular expression.

r{4}

Exactly 4 r's, where r is any regular expression.

"[xyz]\"images"

The literal string [xyz]"images"

\X

If X is a, b, f, n, r, t, or v, then the ANSI-C interpretation of \x; Otherwise, a literal X. This is used to escape operators such as *.

\0

A NULL character.

\123

The character with octal value 123.

\x2a

The character with hexadecimal value 2a.

(r)

Matches an r; where r is any regular expression. You can use parentheses to override precedence.

rs

The regular expression r, followed by the regular expression s.

r|s

Either an r or an s.

#<n>#

Inserts an end node causing regular expression matching to stop when reached. The value n is returned.

Examples
You can specify:
       
dest_domain=mydomain.com                  # to match any host in mydomain.com.
 
Likewise, you can specify:

         dest_domain=.                  #to match any request.

       others:(
regex_map/map与regex_redirect/redirect,二者的区别在于map充当了代理桥梁,客户浏览器的url不会改变,不需要产生再一次请求.redirect则是告诉客户浏览器,你访问别的url吧,然后就不管了.)
       举例:
     regex_map http://x ([0-9]+).z.com http://real-x$1.z.com
     #

         regex_redirect http://old.(.*).z.com http://new.$1.z.com  #

  评论这张
 
阅读(151)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017