Pattern pattern = Pattern.compile("http://(.*\\.)+.*/.*(\\s|\\z)");
Matcher matcher = pattern.matcher(str);
matcher.replaceAll("<a href="$0">$0</a>");
正規表現で条件に一致した文字列を置換先の文字列に仕込むやり方を使ってみました。色々と応用が効きそうなのでもうちょい正規表現は勉強しなきゃなあ。
Pattern pattern = Pattern.compile("http://(.*\\.)+.*/.*(\\s|\\z)");
Matcher matcher = pattern.matcher(str);
matcher.replaceAll("<a href="$0">$0</a>");
正規表現で条件に一致した文字列を置換先の文字列に仕込むやり方を使ってみました。色々と応用が効きそうなのでもうちょい正規表現は勉強しなきゃなあ。
Why this web site do not have other languages support?
Thank you for your comment.
If there is needs for supporting other languages,I translate my contents to other languages.
But I’m not good at writing any other languages,except Japanese.
Maybe I can just write awful English like this