android 清单中的模式匹配

Pattern matching in android manifest

我正在为 android 实现深层链接,需要知道匹配以下内容的模式 url

<data android:host="*.fa.dk" android:pathPattern="" android:pathPrefix="/Product.aspx" android:scheme="https" />

url将如下

  1. test.fa.dk/Customer_1/Product.aspx(应匹配)
  2. test.fa.dk/Customer_2/Product.aspx(应匹配)
  3. test.fa.dk/Third_Customer_3/Product.aspx(应匹配)

其中 Customer_1/Customer_2/Third_Customer_3 可能包含任何 alphabets/numbers 和 URL 中允许的特殊字符。

您的模式可能看起来像 .*/Product.aspx。这里 .* 匹配任何 0 到多个字符的序列。

<intent-filter android:label="@string/filter_title_viewgizmos">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="https"
          android:host="*.fa.dk"
          android:pathPattern=".*/Product.aspx" />
</intent-filter>