continue;
}
//has to be the last
- if( s.indexOf( "&", i ) == i ) {
- buf.append( "&" ); i += 0;
- continue;
- }
+ //if( s.indexOf( "&", i ) == i ) {
+ // buf.append( "&" ); i += 0;
+ // continue;
+ //}
}
// convert umlauts an other special charakters
switch( s.charAt(i) ) {
*/
public static String createURLLinks(String haystack) {
try {
+
//dieser Ausdruck brauch dringend fachliche Beratung
- RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/([^ \t\r\n<>]+[^ \t\r\n.,<>])");
+ //RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_:-]+)/([^ \t\r\n<>)]+[^ \t\r\n,<>])");
+ RE regex = new RE("((https://)|(http://)|(ftp://)){1}([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>\\)\\]]+[^ \t\r\n.,<>\\)\\]])");
return regex.substituteAll(haystack,"<a href=\"$0\">$0</a>");
} catch(REException ex){
return null;
public static String createURLLinks(String haystack, String title, String imageRoot,String extImage) {
try {
//dieser Ausdruck brauch dringend fachliche Beratung
- RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>]+[^ \t\r\n.,<>])");
+ RE regex = new RE("((https://)|(http://)|(ftp://)){1}([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>\\)\\]]+[^ \t\r\n.,<>\\)\\]])");
+
if (title == null) {
return regex.substituteAll(haystack,"<img src=\""+imageRoot+"/"+extImage+"\" border=\"0\"/> <a href=\"$0\">$0</a>");
} else {