Fredrik Lundh wrote:
> Magnus Lycka wrote:
> r"(\d\d[A-Z]{3}\d\d) (\d\d[A-Z]{3}\d\d) (?=[1234567])(1?2?3?4?5?6?7?)"
>
Thanks a lot. (I knew about {3} of course, I was in a hurry
when I posted since I was close to missing my train...)
--
http://mail.python.org/mailman/listinfo/python-list
Schüle Daniel wrote:
> >>> txt = "21MAR06 31APR06 1236"
>
> >>> m = '(?:JAN|FEB|MAR|APR|MAI|JUN|JUL|AUG|SEP|OCT|NOV|DEZ)'
> # non capturing group (:?)
>
> >>> p = re.compile(r"(\d\d%s\d\d) (\d\d%s\d\d)
> (?=[1234567])(1?2?3?4?5?6?7?)" % (m,m))
>
> >>> p.match(txt).group(1)
> '21MAR06'
>
>
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I want an re that matches strings like "21MAR06 31APR06 1236",
> where the last part is day numbers (1-7), i.e it can contain
> the numbers 1-7, in order, only one of each, and at least one
> digit. I want it as three grou
"Jim" <[EMAIL PROTECTED]> writes:
>Eddie Corns wrote:
>> Just a small point - what does "in order" mean here? if it means that eg 1362
>> is not valid then you're stuck because it's context sensitive and hence not
>> regular.
>I'm not seeing that. Any finite language is regular -- as a last
>res
"Fredrik Lundh" <[EMAIL PROTECTED]> writes:
>Eddie Corns wrote:
>> >I want an re that matches strings like "21MAR06 31APR06 1236",
>> >where the last part is day numbers (1-7), i.e it can contain
>> >the numbers 1-7, in order, only one of each, and at least one
>> >digit. I want it as three grou
Eddie Corns wrote:
> Just a small point - what does "in order" mean here? if it means that eg 1362
> is not valid then you're stuck because it's context sensitive and hence not
> regular.
I'm not seeing that. Any finite language is regular -- as a last
resort you could list all ascending sequence
Eddie Corns wrote:
> >I want an re that matches strings like "21MAR06 31APR06 1236",
> >where the last part is day numbers (1-7), i.e it can contain
> >the numbers 1-7, in order, only one of each, and at least one
> >digit. I want it as three groups. I was thinking of
>
> Just a small point - wha
Magnus Lycka <[EMAIL PROTECTED]> writes:
>I want an re that matches strings like "21MAR06 31APR06 1236",
>where the last part is day numbers (1-7), i.e it can contain
>the numbers 1-7, in order, only one of each, and at least one
>digit. I want it as three groups. I was thinking of
Just a small p
Magnus Lycka wrote:
> I want an re that matches strings like "21MAR06 31APR06 1236",
> where the last part is day numbers (1-7), i.e it can contain
> the numbers 1-7, in order, only one of each, and at least one
> digit. I want it as three groups. I was thinking of
>
> r"(\d\d[A-Z]\d\d) (\d\d[A-Z]
Magnus Lycka wrote:
> I want an re that matches strings like "21MAR06 31APR06 1236",
> where the last part is day numbers (1-7), i.e it can contain
> the numbers 1-7, in order, only one of each, and at least one
> digit. I want it as three groups. I was thinking of
>
> r"(\d\d[A-Z]\d\d) (\d\d[A-Z]
Magnus Lycka wrote:
> I want an re that matches strings like "21MAR06 31APR06 1236",
> where the last part is day numbers (1-7), i.e it can contain
> the numbers 1-7, in order, only one of each, and at least one
> digit. I want it as three groups. I was thinking of
>
> r"(\d\d[A-Z]\d\d) (\d\d[A-Z]
I want an re that matches strings like "21MAR06 31APR06 1236",
where the last part is day numbers (1-7), i.e it can contain
the numbers 1-7, in order, only one of each, and at least one
digit. I want it as three groups. I was thinking of
r"(\d\d[A-Z]\d\d) (\d\d[A-Z]\d\d) (1?2?3?4?5?6?7?)"
but tha
12 matches
Mail list logo