Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![vikas pal](https://secure.gravatar.com/avatar/7827f154b2716ccfe9a028f89b9eb987?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
vikas pal
11,563 Pointswhat the difference?
Please see the video first before giving the answer .In the video he uses this '^' and this'$' .So what difference it make in the code and the output in the shell is still same nothing is different.so why we used it and using multiline flag no difference is found in the output and please also tell me what \t do.
![vikas pal](https://secure.gravatar.com/avatar/7827f154b2716ccfe9a028f89b9eb987?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
vikas pal
11,563 Points1 Answer
![Ken Alger](https://secure.gravatar.com/avatar/cf2cad7e6e37acacfa5201068856ed3d?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ken Alger
Treehouse TeacherVikas;
These symbols, ^
and $
are anchors, or atomic zero-width assertions, and specify a position in the string where a match much occur.
The ^
anchor indicates that the match must occur at the beginning of the string or line. While the $
anchor indicates that the match must occur at the end of the string or line, or before \n at the end of the string or line.
For example, ^\d{3}
will match "901" in "901-331-" since it starts at the beginning of the string, while \d{3}$
would match "331" in the same string since it matches at the end of the string.
Hope that helps and happy coding,
Ken
![vikas pal](https://secure.gravatar.com/avatar/7827f154b2716ccfe9a028f89b9eb987?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
vikas pal
11,563 Pointsthank you so much you easily cleared by doubts.i send a message to you on twitter.please start talk to me so i can ask question from you and easily get my answers.Ken Alger
vikas pal
11,563 Pointsvikas pal
11,563 PointsKenneth Love