android - pathPattern to match file extension does not work if a period exists elsewhere in the file name? -


I see many examples of using pathPattern to define an intention filter for a specific file extension / type; For example, pathPattern = ". * \ .xyz" .

Unfortunately, this does not work properly if the file in question is somewhere else in the path; For example, "my.filename.xyz"

Is there a PathParton syntax that will match both "MyFillName.exes" and "MyFillName.exe"?

The Android team chose in a unfortunate way to implement Pathton. You can take a look at how you can implement pattern matching for Android. Pattern Match Class:

We use it. * This work is in regular expression, where * match is greedy and will match as many characters as possible. In the implementation of Pietermill, this match is not greedy.

Example:

string: "/ mnt / my.file". *. .mytype "Path Pattern:" * \\. Mytype "

In Path". * "Pathner will match the alias /" / mnt / my ", and therefore will not be able to match the string.

Given this limit, I do not see any way to write PathParton". Can match any string that ends in "mytype". You can follow Jason's solution to add additional patterns to match the path with multiple points as you specify the pattern Doors are.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -