Both methods work well, thank you!
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 1, 1:38 pm, Rehceb Rotkiv <[EMAIL PROTECTED]> wrote:
> In the re documentation, it says that the matching functions return "non-
> overlapping" matches only, but I also need overlapping ones. Does anyone
> know how this can be done?
Perhaps lookahead assertions are what you're
looking for?
On Apr 1, 9:38 pm, Rehceb Rotkiv <[EMAIL PROTECTED]> wrote:
> In the re documentation, it says that the matching functions return "non-
> overlapping" matches only, but I also need overlapping ones. Does anyone
> know how this can be done?
Something like the following:
import re
s = ""
p
André Søreng wrote:
> With the re/sre module included with Python 2.4:
>
> pattern = "(?Pavi)|(?Pavi|mp3)"
> string2match = "some string with avi in it"
> matches = re.finditer(pattern, string2match)
> ...
> matches[0].groupdict()
> {'id2': None, 'id1': 'avi'}
>
> Which was expected since overlapp