I'm writing Scala code which splits a line based on a colon (:). Example, for an input which looked like:
sparker0i@outlook.com : password
I was doing line.split(" : ")
(which is essentially Java) and printing the email and the password on Console.
Now my requirement has changed and now a line will look like:
(sparker0i@outlook.com,sparker0i) : password
I want to individually print the email, username and password separately.
I've tried Regex by first trying to split the parantheses, but that didn't work because it is not correct (val lt = line.split("[\\\\(||//)]")
). Please guide me with the correct regex/split logic.