KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm learning Scala, so this is probably pretty noob-irific. I want to have 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.
Tags (comma-separated)
Save Edits
Cancel