[TriPython] Regular Expressions

Luis Valencia livalencia at my.waketech.edu
Tue Nov 8 08:52:32 EST 2016


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
-------------- next part --------------
   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


More information about the TriZPUG mailing list