Selesai

Pattern or regex in Java to delete the hyperlinks in the text descritpion

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

Keahlian: Java, Regular Expressions

Lihat lebih lanjut: java code parse text file database, java write class text file, java examples parse text, java regex match url path, java string contains regex, java regex matcher, java string matches regex, java regex online, java regex replace pattern, java regex example, java regex special characters, java socket server text file, delete backgrounds text, java parser class text, java input chinese text field, java class parsing text files, picture image pattern recognition java source code, writing java app parse text file, java code parse text file, java search parse text

Tentang Pemberi kerja:
( 23 ulasan ) Stockholm, United Arab Emirates

ID Proyek: #17965671

Diberikan kepada:

kannanrbkr

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 Lebih banyak

$10 USD dalam 1 hari
(0 Ulasan)
0.0

4 freelancer menawar dengan rata-rata $17 untuk pekerjaan ini

usman1493

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

$30 USD dalam 1 hari
(126 Ulasan)
6.2
arvaibhav

Hi, This is Vaibhav I have experience in making a desktop application using java [login to view URL]!AjQ_3RyyWk98oEj7yMTI4Uxkg1ET CNC simulator [login to view URL]!AjQ_3RyyWk98oBVPlMYWfdxp5bbp Custom music player ht Lebih banyak

$13 USD dalam 1 hari
(13 Ulasan)
3.8
FlainFire

Hello Hope you are well. I can write to you such an regex for an one day. Just accept me. Best regards, Alex.

$15 USD dalam 1 hari
(0 Ulasan)
0.0