remove Img Tag markdown - Java java.lang

Java examples for java.lang:String Markdown

Description

remove Img Tag markdown

Demo Code


//package com.java2s;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    private static String removeImgTag(String brief) {
        String pString = "(\\!\\[image)(.*?)(\\]\\()(.*?)(\\))";
        Pattern pattern = Pattern.compile(pString, Pattern.MULTILINE);
        Matcher matcher = pattern.matcher(brief);
        while (matcher.find()) {
            brief = brief.replace(matcher.group(0), "");
        }// w  w  w  .j a v a  2s  .c  om
        return brief;
    }
}

Related Tutorials