Fix regex issue

This commit is contained in:
stom79 2018-09-06 19:20:31 +02:00
parent 443a9b6fc1
commit fdd27a3f6a
1 changed files with 3 additions and 2 deletions

View File

@ -786,8 +786,9 @@ public class Status implements Parcelable{
@Override
public void onClick(View textView) {
String finalUrl = url;
//Pattern link = Pattern.compile("https?:\\/\\/([\\da-z\\.-]+\\.[a-z\\.]{2,6})\\/(@[\\/\\w._-]*[0-9]*)");
if( url.contains("@")){
Pattern link = Pattern.compile("https?:\\/\\/([\\da-z\\.-]+\\.[a-z\\.]{2,6})\\/(@[\\w._-]*[0-9]*)(\\/[0-9]{1,})?$");
Matcher matcherLink = link.matcher(url);
if( matcherLink.find()){
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra(INTENT_ACTION, SEARCH_REMOTE);
intent.putExtra(SEARCH_URL, url);