There is a text file that I want to parse, namely, read the data line but exclude several elements from it.
String examples:
бла-бла-бла 12312312 бла-бла-бла-бла983-бла {1} {12 000 123,09} бла-бла-бла 123123123123 {3} {020 123,09} бла-бла-бла 12312312934393123 бла93-бла0-бла {123,09} it is necessary when reading the string to get rid of the numbers in curly brackets. If that put braces for selection, in fact they are not. How to exclude them? I tried to split regular expressions with something like:
String b = "строки"; String[] a = b.trim().split("^(?!0.*$)([0-9]{1,3}( [0-9]{3})?( [0-9]{3})?( [0-9]{3})?(,[0-9]{2})?)$") But I suspect that I am doing wrong. Please help by example.
b? One line of typeбла-бла-бла 123123123123 {3} {020 123,09}? Are numbers always in curly braces at the end of a line? TryString result = b.replaceAll("(?:\\s*\\{[^{}]*})+\\s*$", "");. - Wiktor Stribiżew