Android Open Source - MyTwitter-Android String Match Utils






From Project

Back to project page MyTwitter-Android.

License

The source code is released under:

Apache License

If you think the Android project MyTwitter-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.fukata.android.mytw.util;
//from w ww . j av  a  2s. c  om
import java.util.ArrayList;
import java.util.List;
import java.util.regex.MatchResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * ??????????????????
 * 
 * @author smeghead
 *
 */
public class StringMatchUtils {
  static final Pattern URL_PATTERN = Pattern.compile("(https?://)[\\w\\.\\-/:\\#\\?\\=\\&\\;\\%\\~\\+\\@\\,\\_\\!\\*\\(\\)]+", Pattern.MULTILINE | Pattern.DOTALL);

  /**
   * ?????????????????URL?List????????
   * @param str ???????
   * @return URL List
   */
  public static List<String> getUrls(String str) {
    List<String> urls = new ArrayList<String>();
    if (str == null || str.length() == 0) return urls;
    
    Matcher m = URL_PATTERN.matcher(str);
    while (m.find()) {
      MatchResult mr = m.toMatchResult();
      urls.add(str.substring(mr.start(), mr.end()));
    }
    return urls;
  }
}




Java Source Code List

org.fukata.android.mytw.DirectMessageTimelineAdapter.java
org.fukata.android.mytw.DirectMessageTimelineView.java
org.fukata.android.mytw.HomeTimelineView.java
org.fukata.android.mytw.MentionTimelineView.java
org.fukata.android.mytw.MyTwitterActivity.java
org.fukata.android.mytw.MyTwitterApp.java
org.fukata.android.mytw.SettingsActivity.java
org.fukata.android.mytw.TimelineActivity.java
org.fukata.android.mytw.TimelineAdapter.java
org.fukata.android.mytw.TimelineItem.java
org.fukata.android.mytw.TimelineView.java
org.fukata.android.mytw.UpdateStatusActivity.java
org.fukata.android.mytw.database.MyTwitterDB.java
org.fukata.android.mytw.database.dao.BaseDao.java
org.fukata.android.mytw.database.dao.TweetDao.java
org.fukata.android.mytw.database.dto.TweetDto.java
org.fukata.android.mytw.database.schema.TweetSchema.java
org.fukata.android.mytw.receiver.InstallAnalyticsReceiver.java
org.fukata.android.mytw.twitter.Twitter.java
org.fukata.android.mytw.twitter.rs.Status.java
org.fukata.android.mytw.twitter.rs.User.java
org.fukata.android.mytw.util.PrettyDateUtil.java
org.fukata.android.mytw.util.SettingUtil.java
org.fukata.android.mytw.util.StringMatchUtils.java
org.fukata.android.mytw.util.StringUtils.java