forked from avwo/whistle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# pathReplace | ||
|
||
类似js字符串的replace方法,利用正则或字符串来匹配替换请求url的path部分(如`http://www.test.com/xxx?xxx`,只能替换url中`xxx?xxx`这部分的内容),配置方式: | ||
|
||
pattern pathReplace://filepath | ||
|
||
filepath为[Values](http://local.whistlejs.com/#values)里面的{key}或者本地文件(如:`e:\test\xxx`、`e:/test/xxx`、`/User/username/test/xxx`等): | ||
|
||
/user=([^&])/ig: user=$1$1 | ||
str: replacement | ||
|
||
pattern参见[匹配模式](../pattern.html),更多模式请参考[配置方式](../mode.html),json格式参考[操作值](../data.html)。 | ||
|
||
例子: | ||
|
||
www.ifeng.com pathReplace://{test-resReplace.json} | ||
|
||
|
||
test-pathReplace.json: | ||
|
||
/user=([^&])/ig: user=$1$1 | ||
index: news |