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

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