2 coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar)
3 Understanding is not required. Only obedience.
5 This program is free software. It comes without any warranty, to
6 the extent permitted by applicable law. You can redistribute it
7 and/or modify it under the terms of the Do What The Fuck You Want
8 To Public License, Version 2, as published by Sam Hocevar. See
9 http://sam.zoy.org/wtfpl/COPYING for more details.
16 (rexStr, ' | ', string, ' |') printNl.
17 ('start=', matchStart, '; end=', matchEnd) printNl.
18 1 to: captures size do: [:m |
19 ' cpt #' print. m print. '=' print. (self captureAt: m) printNl.
27 rm := SimpleRegExp new: '([a-b])+(c).*'.
28 (rm matchFor: 'abcd') printNl. rm showCaptures.
29 (rm matchFor: 'dabcd') printNl. rm showCaptures.
32 rm := SimpleRegExp new: '^([a-b])+(c).*$'.
33 (rm matchFor: 'abcd') printNl. rm showCaptures.
34 (rm matchFor: 'dabcd') printNl. rm showCaptures.
37 rm := SimpleRegExp new: '^([a-b])+(c)$'.
38 (rm matchFor: 'abc') printNl. rm showCaptures.
39 (rm matchFor: 'abcd') printNl. rm showCaptures.
40 (rm matchFor: 'dabcd') printNl. rm showCaptures.
43 rm := SimpleRegExp new: '([a-b])+?.'.
44 (rm matchFor: 'abcd') printNl. rm showCaptures.
45 (rm matchFor: 'dabcd') printNl. rm showCaptures.
48 rm := SimpleRegExp new: '([a-b])+.'.
49 (rm matchFor: 'abcd') printNl. rm showCaptures.
50 (rm matchFor: 'dabcd') printNl. rm showCaptures.