root/trunk/tests/rex.md

Revision 172, 0.5 kB (checked in by JarrettBillingsley, 2 years ago)

--

Line 
1 module tests.rex;
2
3 regexp.test("ab", "abc");
4 regexp.test("ab", "abc", "g");
5 regexp.replace("ab", "abc", "d");
6 regexp.replace("ab", "abc", "d", "g");
7 regexp.replace("ab", "abc", function(x) x.match(0));
8 regexp.split("ab", "abc");
9 regexp.split("ab", "abc", "g");
10 regexp.match("ab", "abc");
11 regexp.match("ab", "abc", "g");
12 regexp.compile("ab", "g");
13 local re = regexp.compile("ab", "g");
14 re.test("abc");
15 re.match("abc");
16 re.replace("abc", "d");
17 re.split("abc");
18 re.find("abc");
19
20 foreach(m; re.search("ababab"))
21 {
22     m.pre();
23     m.post();
24 }
Note: See TracBrowser for help on using the browser.