Skip to content

Latest commit

 

History

History
55 lines (32 loc) · 1.39 KB

README.md

File metadata and controls

55 lines (32 loc) · 1.39 KB

10 Days of Javascript - Day 7

To view solutions, open the file /Day7/index.html in your browser.

Uncomment js connection string:

<script src="js/regexp-I.js"></script>
<!--<script src="js/regexp-II.js"></script>-->
<!--<script src="js/regexp-III.js"></script>-->

to view different solution.

Do not forget to open the Developer panel and see the section Console.

Day 7: Regular Expressions I

Task:

Complete the function in the editor below by returning a RegExp object, re, that matches any string s that begins and ends with the same vowel. Recall that the English vowels are a, e, i, o, and u.

Solution:

In js/regexp-I.js.

Day 7: Regular Expressions II

Task:

Complete the function in the editor below by returning a RegExp object, re, that matches any string s satisfying both of the following conditions:

  • String starts with the prefix Mr., Mrs., Ms., Dr., or Er.

  • The remainder of string s (i.e., the rest of the string after the prefix) consists of one or more upper and/or lowercase English alphabetic letters (i.e., [a-z] and [A-Z]).

Solution:

In js/regexp-II.js.

Day 7: Regular Expressions III

Task:

Complete the function in the editor below by returning a RegExp object, re, that matches every integer in some string s.

Solution:

In js/regexp-III.js.

Return to navigation list