Definition:
Back to the main index of this glossary
>>> import re
>>> french = 'Je pense donc je suis.'
>>> german = 'Übung macht den Meister.'
>>> english = '"Never increase, beyond what is necessary, the number of entities required to explain anything." -- William of Ockham (1285-1349)'
>>> z = [french, german, english]
>>> y = re.compile(r'(..\b..)(?s)')
>>> for list in z:
... if re.search(y,list):
... output = re.search(y, list)
... print output.group(0)
...
Je p
Übu
er i
>>> [/b [blockquote shade=yes]lockquote] >>> for list in z:
... if re.search(y,list):
... output = re.findall(y, list)
... for i in output:
... print i
...
Je p
se d
nc j
e su
Übu
ng m
ht d
en M
er i
se,
nd w
at i
s ne
ry,
he n
er o
f en
es r
ed t
o ex
in a
ng."
- Wi
am o
f Oc
am (
85-1
Back to the main index of this glossary
