All pastes #538079 Raw Edit

Someone

public java v1 · immutable
·published 2007-06-04 23:01 UTC
rendered paste body
	  public static String autolink(String instr) {		  Pattern p = Pattern.compile("([Hh][Tt][Tt][Pp]://(.*?))\\s|\\.\\s|$|\\.$");		  StringBuffer sb = new StringBuffer();		  Matcher m = p.matcher(instr);		  while (m.find()) {			  String r = "<a href=\""+m.group(1)+"\" target=\"browser\">"+m.group(1)+"</a>";			  m.appendReplacement(sb, r);		  }		  return sb.toString();	  }