X-Git-Url: http://nitlanguage.org diff --git a/tests/test_regex_check.nit b/tests/test_regex_check.nit index f499510..a1f84a8 100644 --- a/tests/test_regex_check.nit +++ b/tests/test_regex_check.nit @@ -19,3 +19,27 @@ var re = "a+".to_re #alt1# print "aa".has(re) print "bb".has(re) + +var str = "é12345" + +var re1 = "3".to_re +print str.split(re1) + +var re2 = "5".to_re +print str.split(re2) + +str = "résonnance réseau résultat" + +print str.search_all("rés".to_re).join(", ") + +str = "あついあのあほ" +print str.split("あ(の)?".to_re).join + +for i in str.search_all("あ(の)?".to_re) do + print "Match found : {i}" + print "Submatches: " + var sbs = i.subs + for j in sbs.length.times do + print "[{j}] : {sbs[j] or else "null"} " + end +end