I have a line, they look like this:
div#title.title.top #main.main a.bold#empty.red
They are like haml, and I want to break them down by regular expression, but I don't know how to define it.
val r = """???""".r // HELP val items = "a.bold#empty.red".split(r) items // -> "a", ".bold", "#empty", ".red"
How to do it?
UPDATE
Sorry, everyone, but I need to make this question more difficult. I am very interested in
val r = """(?<=\w)\b"""
But he could not make out the more complex ones:
div#question-title.title-1.h-222_333
Hope it will be processed:
div #question-title .title-1 .h-222_333
I want to know how to improve this regex?
split scala regex
Freewind
source share