summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/ure_split.py
blob: 620fd9052bb1726e475c4d21fe772d1e9e15aa2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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("[a-f]+")
s = r.split("0a3b9")
print(s)