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 = /
Just a quick and dirty addendum: the .r method on RichString converts all strings to scala.util.matching.Regex, so you can do something like this:
"""(?s)a.*b""".r replaceAllIn ( "a\nb\nc\n", "A\nB" )
And that will return
A
B
c
I use this all the time for quick and dirty regex-scripting in the scala console.
Or in this case:
def matchNode( value : String ) : Boolean = {
"""(?s).*().*""".r.findAllIn( text ) match {
case ScriptNode(v) => System.out.println( "found" + v ); true
case _ => System.out.println("not found: " + value ) ; false
}
}
Just my attempt to reduce the use of the word new in code worldwide. ;)