public static FlickrPhoto matchURL(String url,String text){
  Matcher m=GROUPING_PATTERN.matcher(url);
  if (m.matches()) {
    return new FlickrPhoto(m.group(1),null,m.group(2),m.group(3),text);
  }
  m=URL_PATTERN.matcher(url);
  if (m.matches()) {
    return new FlickrPhoto(m.group(1),m.group(2),null,null,text);
  }
 else {
    return null;
  }
}

public static FlickrPhoto matchURL ( String url , String text ) { Matcher m = GROUPING_PATTERN . matcher ( url ) ; if ( m . matches ( ) ) { return new FlickrPhoto ( m . group ( 1 ) , null , m . group ( 2 ) , m . group ( 3 ) , text ) ; } m = URL_PATTERN . matcher ( url ) ; if ( m . matches ( ) ) { return new FlickrPhoto ( m . group ( 1 ) , m . group ( 2 ) , null , null , text ) ; } else { return null ; } }
returns a flickrphoto object if the given url is to a photo or flickr user .
