summaryrefslogtreecommitdiffstats
path: root/python/002-simple-re-within-string.py
blob: 525941890a4feb8fcc4438c90b626a0afa274435 (plain)
1
2
3
4
5
6
7
8
9
version_start, version_stop = reduce(
    lambda acc, x: (acc[0] if acc[0] or not x[1].isdigit() else x[0]+1,
                    acc[0] if not x[1].isdigit() else x[0]+1),
    enumerate(options.version), (0, 0)
)
if not version_start:
    options.version = '0'
else:
    options.version = options.version[version_start-1:version_stop]