Pattern or regex in Java to delete the hyperlinks in the text descritpion
$10-30 USD
Pagado a la entrega
I have a text about a product description .
I want to delete the hyperlinks but i want to keep the <img links .
1- I was able to delete the hyperlinks from the text
by using this Java function
private String removeUrl(String commentstr)
{
String urlPattern = "((https?|ftp|gopher|telnet|file|Unsure):((//)|(\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&]*)";
Pattern p = [login to view URL](urlPattern,Pattern.CASE_INSENSITIVE);
Matcher m = [login to view URL](commentstr);
StringBuffer sb = new StringBuffer([login to view URL]());
while ([login to view URL]()) {
[login to view URL](sb, "");
}
return [login to view URL]();
}
2- I need it to exclude hyperlinks that are images , So something you can write to exclude delete links that ends with png, jpg or such . you choose the way you want
Nº del proyecto: #17965671
Sobre el proyecto
Adjudicado a:
Hi, I am a web developer with 8+ years of experience. To remove image urls from a comment, there are several ways to do it. One such way is to check the image extension that way will be more robust. Couldn't able Más
4 freelancers están ofertando un promedio de $17 por este trabajo
Hey A Java expert developer is here I have good advanced expertise in Java and Javafx I can help you in your regex task This is an initial bid Feel free to message me Regards
Hello Hope you are well. I can write to you such an regex for an one day. Just accept me. Best regards, Alex.