[TriPython] Regular Expressions
Luis Valencia
livalencia at my.waketech.edu
Wed Nov 9 08:45:45 EST 2016
Thank you all for your help!
________________________________
From: TriZPUG <trizpug-bounces+livalencia=my.waketech.edu at python.org> on behalf of David Handy <david at handysoftware.com>
Sent: Tuesday, November 8, 2016 1:17:43 PM
To: Triangle (North Carolina) Python Users Group (formerly TriZPUG)
Subject: Re: [TriPython] Regular Expressions
Thank you, Jon! I checked the Python re module documentation [1] again and again and couldn't find any reference to \p{L}. It's good to know that I'm not going blind; it truly is not supported.
Luis, your regular expression is not working because you are trying to use non-supported features.
David H
[1] https://docs.python.org/3/library/re.html#module-re
On Tuesday, November 8, 2016 9:42am, "Jon Alligood" <j.alligood47 at gmail.com> said:
> _______________________________________________
> TriZPUG mailing list
> TriZPUG at python.org
> https://mail.python.org/mailman/listinfo/trizpug
> http://tripython.org is the Triangle Python Users GroupQuick question: are you
> using re?
>
> The re module in python doesn't support \p{L} sadly. You will have to
> install the regex package (https://pypi.python.org/pypi/regex/2016.10.22)
> which should have the support for the full unicode letter search.
>
> Cheers,
> Jon
>
> On Tue, Nov 8, 2016 at 8:52 AM, Luis Valencia <livalencia at my.waketech.edu>
> wrote:
>
>> Hello all,
>>
>> I have the following regex pattern for matching: "^[0-9\p{L} _\.]+$". I
>> can use this to match if someone's name does not match the said
>> pattern before making a call to the API.
>>
>> The documentation states the following:
>>
>> "The full set of allowed characters across regions includes any visible
>> Unicode letter characters, digits (0-9), spaces, underscores, and
>> periods.
>> Other than that, no punctuation characters are allowed. Thus, the
>> regular
>> expression to use for validating summoner names would be "^[0-9\p{L}
>> _\.]+$". You should be rejecting inputs that don't match this regular
>> expression (i.e., that contain any punctuation characters other than
>> periods, underscores, and spaces), rather than sending them to the API."
>>
>> When I try to test and type any punctuation characters other than
>> periods,
>> underscores, and spaces the pattern fails to recognize them.
>>
>> Any regex experts that could point me in the right direction. I am
>> perhaps
>> not understanding this correctly, and an explanation would be greatly
>> appreciated.
>>
>> All the best,
>>
>> Luis
>>
>> _______________________________________________
>> TriZPUG mailing list
>> TriZPUG at python.org
>> https://mail.python.org/mailman/listinfo/trizpug
>> http://tripython.org is the Triangle Python Users Group
>>
> Quick question: are you using re?
> The re module in python doesn't support \p{L} sadly. You will have to
> install the regex package
> ([1]https://pypi.python.org/pypi/regex/2016.10.22) which should have the
> support for the full unicode letter search.
> Cheers,
> Jon
> On Tue, Nov 8, 2016 at 8:52 AM, Luis Valencia
> <[2]livalencia at my.waketech.edu> wrote:
>
> Hello all,
>
> I have the following regex pattern for
> matching: "^[0-9\p{L}
> _\.]+$". I
> can use this to match if someone's name does not match the
> said
> pattern before making a call to the API.
>
> The documentation states the following:
>
> "The full set of allowed characters across regions
> includes any
> visible
> Unicode letter characters, digits (0-9), spaces, underscores,
> and
> periods.
> Other than that, no punctuation characters are allowed. Thus,
> the
> regular
> expression to use for validating summoner names would be
> "^[0-9\p{L}
> _\.]+$". You should be rejecting inputs that don't match this
> regular
> expression (i.e., that contain any punctuation characters other
> than
> periods, underscores, and spaces), rather than sending them to
> the
> API."
>
> When I try to test and type any punctuation characters other
> than
> periods,
> underscores, and spaces the pattern fails to recognize them.
>
> Any regex experts that could point me in the right
> direction. I am
> perhaps
> not understanding this correctly, and an explanation would be
> greatly
> appreciated.
>
> All the best,
>
> Luis
>
> _______________________________________________
> TriZPUG mailing list
> [3]TriZPUG at python.org
> [4]https://mail.python.org/mailman/listinfo/trizpug
> [5]http://tripython.org is the Triangle Python Users Group
>
> References
>
> Visible links
> 1. https://pypi.python.org/pypi/regex/2016.10.22
> 2. mailto:livalencia at my.waketech.edu
> 3. mailto:TriZPUG at python.org
> 4. https://mail.python.org/mailman/listinfo/trizpug
> 5. http://tripython.org/
>
_______________________________________________
TriZPUG mailing list
TriZPUG at python.org
https://mail.python.org/mailman/listinfo/trizpug
http://tripython.org is the Triangle Python Users Group
-------------- next part --------------
Thank you all for your help!
--------------------------------------------------------------------------
From: TriZPUG <trizpug-bounces+livalencia=my.waketech.edu at python.org> on
behalf of David Handy <david at handysoftware.com>
Sent: Tuesday, November 8, 2016 1:17:43 PM
To: Triangle (North Carolina) Python Users Group (formerly TriZPUG)
Subject: Re: [TriPython] Regular Expressions
Â
Thank you, Jon! I checked the Python re module documentation [1] again and
again and couldn't find any reference to \p{L}. It's good to know that I'm
not going blind; it truly is not supported.
Luis, your regular expression is not working because you are trying to use
non-supported features.
David H
[1] [1]https://docs.python.org/3/library/re.html#module-re
On Tuesday, November 8, 2016 9:42am, "Jon Alligood"
<j.alligood47 at gmail.com> said:
> _______________________________________________
> TriZPUG mailing list
> TriZPUG at python.org
> [2]https://mail.python.org/mailman/listinfo/trizpug
> [3]http://tripython.org is the Triangle Python Users GroupQuick
question: are you
> using re?
>
> The re module in python doesn't support \p{L} sadly. You will have to
> install the regex package
([4]https://pypi.python.org/pypi/regex/2016.10.22)
> which should have the support for the full unicode letter search.
>
> Cheers,
> Jon
>
> On Tue, Nov 8, 2016 at 8:52 AM, Luis Valencia
<livalencia at my.waketech.edu>
> wrote:
>
>>Â Â Â Hello all,
>>
>>Â Â Â I have the following regex pattern for matching: "^[0-9\p{L}
_\.]+$". I
>>   can use this to match if someone's name does not match the said
>>Â Â Â pattern before making a call to the API.
>>
>>Â Â Â The documentation states the following:
>>
>>   "The full set of allowed characters across regions includes any
visible
>>Â Â Â Unicode letter characters, digits (0-9), spaces, underscores, and
>> periods.
>>Â Â Â Other than that, no punctuation characters are allowed. Thus, the
>> regular
>>Â Â Â expression to use for validating summoner names would be "^[0-9\p{L}
>>Â Â Â _\.]+$". You should be rejecting inputs that don't match this
regular
>>Â Â Â expression (i.e., that contain any punctuation characters other than
>>Â Â Â periods, underscores, and spaces), rather than sending them to the
API."
>>
>>Â Â Â When I try to test and type any punctuation characters other than
>> periods,
>>Â Â Â underscores, and spaces the pattern fails to recognize them.
>>
>>Â Â Â Any regex experts that could point me in the right direction. I am
>> perhaps
>>Â Â Â not understanding this correctly, and an explanation would be
greatly
>>Â Â Â appreciated.
>>
>>Â Â Â All the best,
>>
>>Â Â Â Luis
>>
>> _______________________________________________
>> TriZPUG mailing list
>> TriZPUG at python.org
>> [5]https://mail.python.org/mailman/listinfo/trizpug
>> [6]http://tripython.org is the Triangle Python Users Group
>>
>Â Â Â Quick question: are you using re?
>Â Â Â The re module in python doesn't support \p{L} sadly. You will have to
>Â Â Â install the regex package
>Â Â Â ([1]https://pypi.python.org/pypi/regex/2016.10.22) which should have
the
>Â Â Â support for the full unicode letter search.
>Â Â Â Cheers,
>Â Â Â Jon
>Â Â Â On Tue, Nov 8, 2016 at 8:52 AM, Luis Valencia
>Â Â Â <[2]livalencia at my.waketech.edu> wrote:
>
>Â Â Â Â Â Â Â Hello all,
>
>Â Â Â Â Â Â Â I have the following regex pattern for
> matching:Â "^[0-9\p{L}
>     _\.]+$". I
>       can use this to match if someone's  name does not match the
> said
>       pattern before making a call to the API.
>
>Â Â Â Â Â Â Â The documentation states the following:
>
>       "The full set of allowed characters across  regions
> includes any
>Â Â Â Â Â visible
>Â Â Â Â Â Â Â Unicode letter characters, digits (0-9), spaces, underscores,
> and
>Â Â Â Â Â periods.
>Â Â Â Â Â Â Â Other than that, no punctuation characters are allowed. Thus,
> the
>Â Â Â Â Â regular
>Â Â Â Â Â Â Â expression to use for validating summoner names would be
> "^[0-9\p{L}
>Â Â Â Â Â Â Â _\.]+$". You should be rejecting inputs that don't match this
> regular
>Â Â Â Â Â Â Â expression (i.e., that contain any punctuation characters other
> than
>Â Â Â Â Â Â Â periods, underscores, and spaces), rather than sending them to
> the
>Â Â Â Â Â API."
>
>Â Â Â Â Â Â Â When I try to test and type any punctuation characters other
> than
>Â Â Â Â Â periods,
>Â Â Â Â Â Â Â underscores, and spaces the pattern fails to recognize them.
>
>       Any regex experts that could point me in the right
> direction. I am
>Â Â Â Â Â perhaps
>Â Â Â Â Â Â Â not understanding this correctly, and an explanation would be
> greatly
>Â Â Â Â Â Â Â appreciated.
>
>Â Â Â Â Â Â Â All the best,
>
>Â Â Â Â Â Â Â Luis
>
>Â Â Â Â Â _______________________________________________
>Â Â Â Â Â TriZPUG mailing list
>Â Â Â Â Â [3]TriZPUG at python.org
>Â Â Â Â Â [4]https://mail.python.org/mailman/listinfo/trizpug
>Â Â Â Â Â [5]http://tripython.org is the Triangle Python Users Group
>
> References
>
>Â Â Â Visible links
>Â Â Â 1. [7]https://pypi.python.org/pypi/regex/2016.10.22
>Â Â Â 2. [8]mailto:livalencia at my.waketech.edu
>Â Â Â 3. [9]mailto:TriZPUG at python.org
>Â Â Â 4. [10]https://mail.python.org/mailman/listinfo/trizpug
>Â Â Â 5. [11]http://tripython.org/
>
_______________________________________________
TriZPUG mailing list
TriZPUG at python.org
[12]https://mail.python.org/mailman/listinfo/trizpug
[13]http://tripython.org is the Triangle Python Users Group
References
Visible links
1. https://docs.python.org/3/library/re.html#module-re
2. https://mail.python.org/mailman/listinfo/trizpug
3. http://tripython.org/
4. https://pypi.python.org/pypi/regex/2016.10.22
5. https://mail.python.org/mailman/listinfo/trizpug
6. http://tripython.org/
7. https://pypi.python.org/pypi/regex/2016.10.22
8. mailto:livalencia at my.waketech.edu
9. mailto:TriZPUG at python.org
10. https://mail.python.org/mailman/listinfo/trizpug
11. http://tripython.org/
12. https://mail.python.org/mailman/listinfo/trizpug
13. http://tripython.org/
More information about the TriZPUG
mailing list