I came across a question that was weirdly formatted with ```
to indent code. As the output was unsexy, it tried to edit it with no luck, here's the question:
I have a Scala regex which does match with pattern.findFirstMatchIn()
but not with a match ... case
unpacking statement:
val pattern = "\"(\\d+?)\",\"(.*?)\",(.+)$".r
val line = "\"1795\",\"title\",\"desc
"
println(pattern.findFirstMatchIn(line).isDefined)
val pattern2Unpacking = line match {
case pattern( category_id, title, description) =>
true
case _ => false
}
println(pattern2Unpacking)
I'm familiar with the bullet list issue but I can't find information on this one, how to format it correctly and why does it occurs?
Note: Feel free to try to edit this post