Stephan van Hulst wrote:You should break up the input string in parts depending on how they're delimited. For instance, the time at the start (including the milliseconds) is delimited by whitespace, So you first want to match as many non-whitespace characters as possible, followed by at least one whitespace character. Use capturing groups for the parts that you're interested in, and use non-capturing groups for delimiters or fluff. That means that the regex for the first part could look like this:
This means: capture zero or more non-whitespace characters, and then match one or more whitespace characters.
For parts of the input string that are enclosed in braces, you would do something like this:
This means: match a '[' and then capture zero or more non-']' characters, and then match a ']' character.
Then you have to compose your entire regex of patterns like this, and then escape all the characters that have a special meaning in strings. I can promise you this will become incredibly messy and unmaintainable. Instead, you will probably want to use java.util.Scanner to process the input string in bits. Have you already looked at its API documentation?
Stephan van Hulst wrote:You would use a regex to get specific information out of a string. What information are you looking for? Do you want to get EVERY piece of information out of the string, or just a few particular parts?
I'm assuming that by the crosses in the input string you mean ANY character, but you just censored out the actual characters.
Handler cannot be resolved to a type
Return type for the method is missing