[TriPython] Regular Expressions

Devin Ceartas devin at nacredata.com
Tue Nov 8 08:59:18 EST 2016


Can you put together some tiny demo code?


devin
--
contact info: http://nacredata.com/devin



> On Nov 8, 2016, at 08:52, 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


More information about the TriZPUG mailing list