I'm having a problem where I need to filter out "longer" path to not be captured by intent filter
.
As printed out in the code below,
PatternMatcher pm = new PatternMatcher("/..*/..*", PatternMatcher.PATTERN_SIMPLE_GLOB);
Boolean b = pm.match("/segment/segment");
Boolean c = pm.match("/segment/segment/segment");
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
alertDialog.setTitle("Alert");
alertDialog.setMessage(b.toString() + ',' + c.toString());
It shows true,true
as the result.
Is there any way to make the result as true,false
?
Changing the regex to /..*/..*/
and url to /segment/segment/
is impossible.
Thank you. I appreciate discussions
^([/][A-Za-z0-9\s!@#$%^&()';{}\[\]=+\-_~`.\\]+){2}
You can use this regular expression to make the result as true, false
if
there is one, three more segments
View Explanation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With