Code: Select all
String expression="a weird case of {asda}something";
Pattern aPattern=Pattern.compile("\\{(.*?)\\}");
Matcher matcher = aPattern.matcher(expression);
boolean match = matcher.matches();
< /code>
Dies wirft immer < /up>
ausException in thread "main" java.lang.IllegalStateException: No match found
< /code>
Ich verstehe nicht, warum es keine Übereinstimmung findet. Die Ausgabe sollte {seinasda}