[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