[Python] aws cognito phone number regex validation faild

Discussão em 'Python' iniciado por Stack, Janeiro 8, 2025.

  1. Stack

    Stack Membro Participativo

    when creating a user from aws via the console. they used below regex validation pattern as per below screenshot.

    regex pattern

    "^\+[1-9][0-9]{0,24}$"


    but when i try this mobile number with python it was matched. but in the console or api it gives an error called invalid mobile number

    sample mobile number +80570497

    [​IMG]

    python script

    >>> re.match(r"^\+[1-9][0-9]{0,24}$", "+80570497")
    <re.Match object; span=(0, 9), match='+80570497'>

    Continue reading...

Compartilhe esta Página