100 Days of Code: Day 41
100 Days of Code, Round 1
Goals For Today:[ultimate_icon_list icon_size=”16″ icon_margin=”20″][ultimate_icon_list_item icon_type=”custom” icon_img=”id^4091|url^https://www.blissfullemon.com/wp-content/uploads/2018/05/done.png|caption^null|alt^null|title^done|description^null”]Complete the Regular Expressions challenges at FCC[/ultimate_icon_list_item][/ultimate_icon_list]
I completed the Regular Expressions challenges at Free Code Camp. I got a little nervous when I got to some of the more challenging exercises, like verifying the username using the rules specified, but was pleasantly surprised that I figured it out in just a few minutes.
- The only numbers in the username have to be at the end. There can be zero or more of them at the end.
- Username letters can be lowercase and uppercase.
- Usernames have to be at least two characters long. A two-letter username can only use alphabet letter characters.
let userCheck = /^\w\D+w*\d*$/;
I’m sure there is a more efficient way than how I chose to do it, but this seemed the most logical way to piece it together in my mind. What changes would you make?
My only real complaint is that it’s allergy season and I am realizing that the allergy medicine I have been taking is produced and/or endorsed by the devil.