Code Monkey home page Code Monkey logo

Comments (3)

avwo avatar avwo commented on July 30, 2024

有两种写法:

# 正则
/https://domain/path-aaa/ran(\d\d)/path-bbb/file-/ file://X:\mock-domain\path-aaa\rand$1

# 通配符
^https://domain/path-aaa/ran*/path-bbb/file-* file://X:\mock-domain\path-aaa\rand$1

参考:https://wproxy.org/whistle/pattern.html

from whistle.

Fredida avatar Fredida commented on July 30, 2024

感谢作者的帮助,抱歉之前表述的有歧义,其实是想把
/https://domain/path-aaa/ran\d\d/path-bbb/file-1
/https://domain/path-aaa/ran\d\d/path-ccc/file-2
都匹配到
file://X:\固定dir\
(X:\固定dir下有path-bbb\file-1和path-ccc\file-2等)
请问该如何撰写规则呢?

提问之前有阅读过帮助文档pattern.html,请问这段描述

最多支持10个子匹配 $0...9,其中$0表示整个请求url,其它跟正则的子匹配一样 /[^?#]/([^\/]+).html/ protocol://...$1...

应该理解为$1为正则第一次匹配之后剩余的后续url部分?那么$2(对应的子匹配)是什么呢?

from whistle.

avwo avatar avwo commented on July 30, 2024

跟正则的子匹配一样,试试:

^https://domain/path-aaa/ran*/** file://X:\固定dir\$2

from whistle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.