2014-09-14 23:14:28 +01:00
|
|
|
try:
|
|
|
|
import ure as re
|
|
|
|
except ImportError:
|
2017-02-14 22:56:22 +00:00
|
|
|
try:
|
|
|
|
import re
|
|
|
|
except ImportError:
|
|
|
|
import sys
|
|
|
|
print("SKIP")
|
|
|
|
sys.exit()
|
2014-09-14 23:14:28 +01:00
|
|
|
|
|
|
|
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")
|
2015-02-21 10:39:41 +00:00
|
|
|
print(s)
|