<metaproperty="description"content="Some methods require the client to verify if the data obtained from an external source matches a certain pattern.">
<metaproperty="og:description"content="Some methods require the client to verify if the data obtained from an external source matches a certain pattern.">
<divid="dev_page_content"><p>Some methods require the client to verify if the data obtained from an external source matches a certain pattern.</p>
<p>For example, when <ahref="/api/auth">requesting a login code</a>, if the chosen verification method is a <ahref="/constructor/auth.sentCodeTypeFlashCall">flash call</a>, it is required that the phone number (which is the login code) matches the specified pattern.</p>
<p>Same with <ahref="/constructor/account.sentEmailCode">email verification codes</a>.</p>
<p>In all cases, the pattern is a string of the same length as the string to verify: and matching is as simple as checking if all chars in the source string are the same as in the pattern string.
Some chars in the pattern string may be censored using an asterisk <code>*</code>, in this case any char in the source string is considered valid.</p>
<p>If the source string is a phone number, it has to be sanitized first to include only the following chars: <code>0123456789</code>.</p>
<p>Example implementation: <ahref="https://github.com/DrKLO/Telegram/blob/9ffc7787d6ed4386363fad001334ae411c2877d9/TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java#L1341">telegram for android</a>.</p></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.