subject

In this exercise we are going to practice validating a password to confirm it contains letters and numbers using simple regular expressins. This exercise uses if statements to find a valid password instead of finding an invalid one. Inside the if statement that is already in the checkPassword(e) function: Create 2 variables, reA and reB. Assign one of the variables the regular expression for a number, assign the other the regular expression that will match any uppercase or lowercase letter. Place your regular expressions between //. Unlike the examples in lecture, you do not want to use ^ at the start of your regular expression or the $ at the end because that requires that you match ALL characters in the string instead of just looking for one. Create a second if statement (nested inside the first if statement) that checks if the password matches both regular expression variables: Call the test method on reA and pass it the value of the password entered in the pwd input. Call the test method on reB and pass it the value of the password entered in the pwd input. Note: Use a single if statement that checks that both of these validation conditions are true. Inside the body of the nested (inner) if statement: Set the disabled property of the submit variable to true (because the element passed validation). return true

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:40
Reading characters and strings from the keyboard: consider the following c++ program 1. #include 2. #include 3. using namespace std; 4. mystring1 5. 6. int main() 7. { 8. 9. string mystring1, mystring2; mychar1 10. 11. 12. char mychar1, mychar2; 13. 14. cout< < "enter a string: "; mychar2 15. 16. cin> > mystring1; // 17. cin.get(mychar1); 18. cin> > mychar2; 19. getline(cin,mystring2); mystring2 20. 21. 22. cout<
Answers: 1
question
Computers and Technology, 23.06.2019 23:40
4. what is the reason for including the following code snippet in the header file animal.h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
question
Computers and Technology, 24.06.2019 15:30
Python. primary u.s. interstate highways are numbered 1-99. odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. thus, the 405 services the 5, and the 290 services the 90. given a highway number, indicate whether it is a primary or auxiliary highway. if auxiliary, indicate what primary highway it serves. also indicate if the (primary) highway runs north/south or east/west.
Answers: 1
question
Computers and Technology, 25.06.2019 02:30
One important thing in finding employment is to get your resume noticed and read.true or false
Answers: 2
You know the right answer?
In this exercise we are going to practice validating a password to confirm it contains letters and n...
Questions
question
Mathematics, 14.01.2022 01:50
question
Mathematics, 14.01.2022 01:50
question
English, 14.01.2022 01:50
question
Mathematics, 14.01.2022 01:50
Questions on the website: 13722360