// retoor <retoor@molodetz.nl>
import "regex" for Regex, Match
var ri = Regex.new("hello", "i")
System.print(ri.test("HELLO")) // expect: true
System.print(ri.test("Hello")) // expect: true
System.print(ri.test("hElLo")) // expect: true
System.print(ri.pattern) // expect: hello
System.print(ri.flags) // expect: i
var rm = Regex.new("^line", "m")
var multiline = "first\nline two\nline three"
System.print(rm.test(multiline)) // expect: true
System.print(rm.pattern) // expect: ^line
System.print(rm.flags) // expect: m
var rm2 = Regex.new("^first", "m")
System.print(rm2.test(multiline)) // expect: true
var rm3 = Regex.new("two$", "m")
System.print(rm3.test(multiline)) // expect: true
var rs = Regex.new("first.line", "s")
var withNewline = "first\nline"
System.print(rs.test(withNewline)) // expect: true
System.print(rs.pattern) // expect: first.line
System.print(rs.flags) // expect: s
var rnos = Regex.new("first.line")
System.print(rnos.test(withNewline)) // expect: true
var rim = Regex.new("^hello", "im")
var multiCase = "WORLD\nHELLO"
System.print(rim.test(multiCase)) // expect: true
System.print(rim.pattern) // expect: ^hello
System.print(rim.flags) // expect: im
var ris = Regex.new("a.b", "i")
System.print(ris.test("A\nB")) // expect: true
var plain = Regex.new("test")
System.print(plain.pattern) // expect: test
System.print(plain.flags) // expect:
var rims = Regex.new("^hello.world", "ims")
var complex = "START\nHELLO\nWORLD"
System.print(rims.test(complex)) // expect: true