Test Your Knowledge
What JavaScript method can you use to send a form for validation prior to submitting it?
What JavaScript method is used to match a string against a regular expression?
Write a regular expression to match any characters that are nonword characters, as defined by regular expression syntax.
Write a regular expression to match either of the words âfoxâ or âfix.â
Write a regular expression to match any single word followed by any nonword character.
Using regular expressions, write a JavaScript function to test whether the word âfoxâ exists in the string âThe quick brown foxâ.
Using regular expressions, write a PHP function to replace all occurrences of the word âtheâ in âThe cow jumps over the moonâ with the word âmy.â
What HTML keyword is used to precomplete form fields with a value?
See Chapter 16 Answers in Appendix A for the answers to these questions.
Get Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.