Anyone any good with Regex? Struggling with this. ...
# announcements
l
Anyone any good with Regex? Struggling with this.
1914   1    5.9     0.9    ---     48.3    ---
What I have so far:
([\d]+)\.*([\s]+)
I just want to extract all the non-whitespace values into an Array.
r
Why not just use split?
l
because there's an unknown number of spaces between each value, so using
.split(" ")
doesnt help.
r
I could be wrong, but I believe if you don't pass in a delimiter (i.e. just
.split()
), it will do what you want. If not, you could just use
\s+
as your delimiter.
l
image.png
You're right, it's just not behaving as I thought it would.
OK, the key is using the
Regex
class.
r
Ah, indeed. Sorry about that. I'm glad you figured it out.