# What does this pattern do?

**URL:** <https://www.phphelp.com/t/what-does-this-pattern-do/32507>\
**Category:** General PHP Help\
**Created:** [September 11, 2020, 5:00pm UTC](https://www.phphelp.com/t/what-does-this-pattern-do/32507 "2020-09-11T17:00:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stowman](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/a5b964/32.png) [@stowman](https://www.phphelp.com/u/stowman)\
**Post date:** [September 11, 2020, 5:00pm UTC](https://www.phphelp.com/t/what-does-this-pattern-do/32507/1 "2020-09-11T17:00:38Z")

</div>

I have some code which includes the following:  
pattern="[a-z0-9.\_%±]+@[a-z0-9.-]+.[a-z]{2,4}$"  
Could some kind person step through this and explain to me what each part of this code actually does? Thank you

---

<div class="post-metadata">

**Author:** ![tbeckett1211](https://www.phphelp.com/letter_avatar_proxy/v4/letter/t/8797f3/32.png) [@tbeckett1211](https://www.phphelp.com/u/tbeckett1211)\
**Post date:** [September 21, 2020, 11:59pm UTC](https://www.phphelp.com/t/what-does-this-pattern-do/32507/2 "2020-09-21T23:59:25Z")

</div>

That is basically verifying that it is an email address.  
Its saying at least one A-Z or 0-9 or . or \_ etc  
then the @ symbol  
then a domain name at least one character  
then the dot  
then A-Z two to four times…
