Hi, I'm learning Scala, so this is probably pretty noob-irific.
I want to to a multiline regular expression.
In Ruby it would be:
MY_REGEX = /com:Node/m
My Scala looks like:
val ScriptNode = new Regex("""<com:Node>""")
Here's my match function:
def matchNode( value : String ) : Boolean = value match
{
case ScriptNode() => System.out.println( "found" + value ); true
case _ => System.out.println("not found: " + value ) ; false
}
And I'm calling it like so:
matchNode( "<root>\n<com:Node>\n</root>" ) // doesn't work
matchNode( "<com:Node>" ) // works
I've tried:
val ScriptNode = new Regex("""<com:Node>?m""")
And I'd really like to avoid having to use java.util.regex.Pattern. Any tips greatly appreciated.