diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-10-11 18:55:44 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-10-11 18:55:44 +0100 |
| commit | 37671c9a973d20248048343cb168c50f6bbca959 (patch) | |
| tree | 1bac386c924a0a8bd289bd4a36f3af9974283a33 /tests/extmod/ure_split.py | |
| parent | 1ce916aefdaee7bca2bcf2bc4ee7e1eb75002f67 (diff) | |
| parent | dd5ee9ff9c67575897ccfa8b4e8b10abecbe9800 (diff) | |
Merge branch 'pfalcon-modure'
Diffstat (limited to 'tests/extmod/ure_split.py')
| -rw-r--r-- | tests/extmod/ure_split.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/extmod/ure_split.py b/tests/extmod/ure_split.py new file mode 100644 index 000000000..0154f3abc --- /dev/null +++ b/tests/extmod/ure_split.py @@ -0,0 +1,35 @@ +try: + import ure as re +except ImportError: + import re + +r = re.compile(" ") +s = r.split("a b c foobar") +print(s) + +r = re.compile(" +") +s = r.split("a b c foobar") +print(s) + +r = re.compile(" +") +s = r.split("a b c foobar", 1) +print(s) + +r = re.compile(" +") +s = r.split("a b c foobar", 2) +print(s) + +r = re.compile(" *") +s = r.split("a b c foobar") +# TODO - no idea how this is supposed to work, per docs, empty match == stop +# splitting, so CPython code apparently does some dirty magic. +#print(s) + +r = re.compile("x*") +s = r.split("foo") +print(s) + +r = re.compile("[a-f]+") +s = r.split("0a3b9") +# TODO - char classes are not yet supported by re1.5 +#print(s) |
