In MRAB
writes:
>kj wrote:
>>
>> re.findall finds all non-overlapping matches, but what if one wants
>> all (maximal) matches, even those that overlap?
>>
>> All the solutions I can come up involve calling re.search iteratively,
>> each time giving it
kj wrote:
re.findall finds all non-overlapping matches, but what if one wants
all (maximal) matches, even those that overlap?
All the solutions I can come up involve calling re.search iteratively,
each time giving it a pos parameter starting just after the start
of the previous match.
Is
re.findall finds all non-overlapping matches, but what if one wants
all (maximal) matches, even those that overlap?
All the solutions I can come up involve calling re.search iteratively,
each time giving it a pos parameter starting just after the start
of the previous match.
Is there a built
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 ar
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:
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?
Regards,
Rehceb Rotkiv
--
http://mail.python.org/mailman/listinfo/python-list
x27;: None, 'id1': 'avi'}
>
> Which was expected since overlapping matches are ignored.
> But I would also like to know if other groups had a match.
that's not how regular expressions work: a regular expression describes a
set of strings (the regular set), and the engine
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