Regex Captures in Java, as in C #

I need to rewrite part of an existing C # /. NET program using Java. I am not so fluent in Java, and I am missing something that processes regular expressions, and I just want to find out if I am missing something or if Java just does not provide such a function.

I have data like

2011:06:05 15:50\t0.478\t0.209\t0.211\t0.211\t0.205\t-0.462\t0.203\t0.202\t0.212

I am using a Regex template that looks like this:

?(\d{4}:\d{2}:\d{2} \d{2}:\d{2}[:\d{2}]?)\t((-?\d*(\.\d*)?)\t?){1,16}

In .NET, I can access the values ​​after matching with match.Group[3].Captures[i].

In Java, I did not find anything like it. matcher.group(3)just returns an empty string.

How can I achieve behaviors like the one I'm used to with C #?

+5
source share
1

, Java . :

strg = "0.478\t0.209\t0.211\t0.211\t0.205\t-0.462\t0.203\t0.202\t0.212"

:

String[] values = strg.split("\\t");

+3

All Articles