A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/005395.html below:

[Python-Dev] SRE incompatibility

[Python-Dev] SRE incompatibilitySjoerd Mullender sjoerd@oratrix.nl
Tue, 04 Jul 2000 11:55:41 +0200
>>> regexp = '(([a-z]+):)?([a-z]+)$'
>>> import re
>>> re.match(regexp, 'smil').group(0,1,2,3)
('smil', None, 's', 'smil')
>>> import pre
>>> pre.match(regexp, 'smil').group(0,1,2,3)
('smil', None, None, 'smil')

Needless to say, I am relying on the third value being None...
(My regular expression was actually more like
'(?:(?P<prefix>[a-z]+):)?(?P<suffix>[a-z]+)$' and I check for
result.group('prefix'))

-- Sjoerd Mullender <sjoerd.mullender@oratrix.com>



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4