0

App link in android is not a real regex, but in the developer documentation, since API 26, there is a PATTERN_ADVANCED_GLOB that can do a little bit more that before.

PATTERN_ADVANCED_GLOB added in API level 26

Pattern type: the given pattern is interpreted with a regular expression-like syntax for matching against the string it is tested against. Supported tokens include dot (.) and sets ([...]) with full support for character ranges and the not (^) modifier. Supported modifiers include star (*) for zero-or-more, plus (+) for one-or-more and full range ({...}) support. This is a simple evaluation implementation in which matching is done against the pattern in real time with no backtracking support.

But when i try to use, it doesn't work, I tried:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />

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

    <data
        android:scheme="http"
        android:host="www.example.com"
        android:pathPattern="/[A-Z]+" />
</intent-filter>

and try to use with the URL: www.example.com/ABC

as documentation said [] is range([A-Z]) and the + would be one-or-more

does any one used that before? or know why it's not working?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
tiagoMissiato
  • 305
  • 3
  • 16
  • I don't see any mention of `PATTERN_ADVANCED_GLOB` in the pathPattern documentation at https://developer.android.com/guide/topics/manifest/data-element#path Are you sure it can be used directly with xml `intent-filter`? – Simon Marquis May 24 '18 at 16:11
  • @SimonMarquis in the documentation it says to see https://developer.android.com/reference/android/os/PatternMatcher.html for more information and there you can see PATTERN_ADVANCED_GLOB, I thought that pathPattern would accept all patter in the PatterMatcher doc, so that is not the case? – tiagoMissiato May 25 '18 at 17:01
  • Yeah, it might not be supported from the `intent-filter` mechanism... – Simon Marquis May 25 '18 at 18:49
  • `"For more information on these three types of patterns, see the descriptions of PATTERN_LITERAL, PATTERN_PREFIX, and PATTERN_SIMPLE_GLOB in the PatternMatcher class."` -- Three attributes, three pattern types, and none of them are `PATTERN_ADVANCED_GLOB`. – j__m Jul 13 '18 at 16:28

0 Answers0