Ich verwende einen Regex, um zu finden, ob eine Zeichenfolge auf einer Buchseite vorhanden ist. Unten ist der Code für dasselbe. < /p>
String regex = ".*\\b.{0}" + searchText + ".{0}.*\\b";
Pattern pattern = Pattern.compile(regex);
pattern.matcher("This is the text area where I am trying to look for the particular text, which is in the variable searchText. This text will have the string (222M) as part of this string. The find method should give me a true result even if I don't enter the closing brakect of the word. This is a multiline string").find()
< /code>
Beobachtungen: < /p>
Fall 1: Wenn SearchText = "(222m)" < /li>
Ergebnis: Die String wird gefunden. Fehlende < /p>
Ich bekomme die folgende Ausnahme. Die Zeichenfolge in der Seite zu finden.>
Muster.comPile () löst eine Ausnahme aus ⇐ Java
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Der Kafka -Produzent löst beim Initiieren von Transaktionen eine Ausnahme aus
by Anonymous » » in C# - 0 Replies
- 24 Views
-
Last post by Anonymous
-