Auf Thema antworten

Auch wenn ich dort ein </p> einfüge passiert haargenau das selbe wie vorher.


[code=Java]import java.util.regex.Matcher;

import java.util.regex.Pattern;

import java.io.IOException;

 

public class IndexCreator

{

    public static void main(String[] args) throws IOException

    {

        Pattern pattern = Pattern.compile("<p class=\"question\" style=\"margin:0cm;margin-bottom:.0001pt\">(.*)</p>");

       

        String test = "<p class=\"question\" style=\"margin:0cm;margin-bottom:.0001pt\">Q:" + " " +

        "Ich bin die Frage Nummer 1.</p>" + " " +

        "<p class=\"question\" style=\"margin:0cm;margin-bottom:.0001pt\">Q:" + " " +

        "Ich bin die Frage Nummer 2.</p>";

       

        Matcher matcher = pattern.matcher(test);

        while (matcher.find())

        {

            System.out.println(matcher.group(1));

        }

    }

}[/code]



Oben