On 07/07/2014 19:51, rxjw...@gmail.com wrote:
Will you please do something about the double spaced google crap that
you keep sending, I've already asked you twice.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
---
Th
On Mon, Jul 7, 2014 at 11:51 AM, wrote:
> Would you give me an example using your pattern: `.*` -- `.`?
> I try it, but it cannot pass. (of course, I use it incorrectly)
Those are two patterns.
Python 3.4.1 (default, Jul 7 2014, 13:22:02)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits
On Sunday, July 6, 2014 8:09:57 AM UTC-4, Devin Jeanpierre wrote:
> On Sun, Jul 6, 2014 at 4:51 AM, wrote:
>
> > Hi,
>
> >
>
> > I just begin to learn Python. I do not see the usefulness of '*' in its
>
> > description below:
>
> >
>
> >
>
> >
>
> >
>
> > The first metacharacter for repe
On Sun, Jul 6, 2014 at 4:49 PM, MRAB wrote:
> \d also matches more than just [0-9] in Unicode.
I think that anything matched by \d will also be accepted by int().
>>> decimals = [c for c in (chr(i) for i in range(17 * 2**16)) if
>>> unicodedata.category(c) == 'Nd']
>>> len(decimals)
460
>>> re.
The reason I did not use \d\d* or \d+ or ^\d+$ or any number of
more-correct things was because the OP was new to regexps.
-- Devin
On Sun, Jul 6, 2014 at 3:49 PM, MRAB wrote:
> On 2014-07-06 18:41, Albert-Jan Roskam wrote:
>>
>>
>>
>>
>>> In article ,
>>> Rick Johnson wrote:
>>>
As an asi
On 2014-07-06 18:41, Albert-Jan Roskam wrote:
In article ,
Rick Johnson wrote:
As an aside i prefer to only utilize a "character set" when
nothing else will suffice. And in this case r"[0-9][0-9]*"
can be expressed just as correctly (and less noisy IMHO) as
r"\d\d*".
Even better, r"\d+"
>In article ,
> Rick Johnson wrote:
>
>> As an aside i prefer to only utilize a "character set" when
>> nothing else will suffice. And in this case r"[0-9][0-9]*"
>> can be expressed just as correctly (and less noisy IMHO) as
>> r"\d\d*".
>
>Even better, r"\d+"
I tend tot do that too, even th
On Sunday, July 6, 2014 12:38:23 PM UTC-5, Rick Johnson wrote:
> r'\s*#[^\n]'
Well, there i go not testing again!
r'\s*#[^\n]*'
--
https://mail.python.org/mailman/listinfo/python-list
On Sunday, July 6, 2014 11:47:38 AM UTC-5, Roy Smith wrote:
> Even better, r"\d+"
> >>> re.search(r'(\d\d*)', '111aaa222').groups()
> ('111',)
> >>> re.search(r'(\d+)', '111aaa222').groups()
> ('111',)
Yes, good catch! I had failed to reduce your original
pattern down to it's most fundamental aspe
In article ,
Rick Johnson wrote:
> As an aside i prefer to only utilize a "character set" when
> nothing else will suffice. And in this case r"[0-9][0-9]*"
> can be expressed just as correctly (and less noisy IMHO) as
> r"\d\d*".
Even better, r"\d+"
>>> re.search(r'(\d\d*)', '111aaa222').grou
[CONTINUED FROM LAST REPLY...]
Likewise if your intent is to filter out any match strings
which contain non-digits, then define the start and stop
points of the pattern:
# Match only if all are digits
>>> re.match(r'\d\d*$', '111aaa222') # fails
# Match only if all are digits and,
# allow leadin
On Sunday, July 6, 2014 10:50:13 AM UTC-5, Devin Jeanpierre wrote:
> In related news, the regexp I gave for numbers will match "1a".
Well of course it matched, because your pattern defines "one
or more consecutive digits". So it will match the "1" of
"1a" and the "11" of "11a" likewise.
As an asi
In related news, the regexp I gave for numbers will match "1a".
-- Devin
On Sun, Jul 6, 2014 at 8:32 AM, MRAB wrote:
> On 2014-07-06 13:09, Devin Jeanpierre wrote:
>>
>> On Sun, Jul 6, 2014 at 4:51 AM, wrote:
>>>
>>> Hi,
>>>
>>> I just begin to learn Python. I do not see the usefulness of '*'
On 2014-07-06 13:09, Devin Jeanpierre wrote:
On Sun, Jul 6, 2014 at 4:51 AM, wrote:
Hi,
I just begin to learn Python. I do not see the usefulness of '*' in its
description below:
The first metacharacter for repeating things that we'll look at is *. * doesn't
match the literal character *;
On Sun, Jul 6, 2014 at 4:51 AM, wrote:
> Hi,
>
> I just begin to learn Python. I do not see the usefulness of '*' in its
> description below:
>
>
>
>
> The first metacharacter for repeating things that we'll look at is *. *
> doesn't
> match the literal character *; instead, it specifies that th
15 matches
Mail list logo