sách gpt4 ăn đã đi

android - 匹配 中的 url 模式

In lại 作者:IT王子 更新时间:2023-10-28 23:28:33 27 4
mua khóa gpt4 giày nike

我希望我的一项 Activity 能够获取特定的网址。模式是:

http://www.example.com/abc123/foo/xyz789

路径组件“abc123”和“xyz789”可以是任意字母数字序列,长度> 1。

在我的 list 中这样做:



<>
android:name="android.intent.action.VIEW" />
<>
android:name="android.intent.category.DEFAULT" />
<>
android:name="android.intent.category.BROWSABLE" />


android:scheme="http"
android:host="example.com"
android:pathPattern="/.*/foo/.*" />

但似乎我域中的任何模式都在匹配,即:

myexample.com
myexample.com/whatever

两者都匹配。我想也许 .* 运算符没有像我期望的那样工作?任何帮助都会很棒,

Cảm ơn

http://developer.android.com/guide/topics/manifest/data-element.html

câu trả lời hay nhất

我今天也遇到了同样的问题,我的解决方法是:

   

使用 (..*) 代替 (.+)

在原始问题的情况下,我想这可以工作:


android:host="example.com"
android:pathPattern="..*/foo/..*"
android:scheme="http"/>

关于android - 匹配 中的 url 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4762251/

27 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress