Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create 2 files, named a3q1.html and a3q1.js, to implement a simple regular expression testing page, like the one shown below. Try to match the layout

image text in transcribed

Create 2 files, named a3q1.html and a3q1.js, to implement a simple regular expression testing

page, like the one shown below. Try to match the layout in the screenshot. There is no need to

put any CSS code to achieve this layout. The text area should have 10 rows and 80 columns, and

the first 2 input text should have a size of 20 and the last one a size of 5. The title should be an

h1.

All the JavaScript code should be put in the js file, except for connecting the search button with

a search function located in the js file, which has to be included in the head element of the html

file.

Your search function should:

1. start by splitting the text from the text area according to the split characters given in the

first input text box. If the first input text box is empty, then dont split the text

2. create a regular expression by providing the RegExp constructor function the text of the

second and third input boxes (use new RegExp(), not /.../...)

3. test the regular expression on each nonempty word (or element) of the array obtained

from step 1, or on the text directly if no splitting characters were given

4. Output the number of nonempty words in the text, plus the number of words matching

the regular expression.

uestion #1 Create 2 files, named a3q1.html and a3q1.js, to implement a simple regular expression testing page, like the one shown below. Try to match the layout in the screenshot. There is no need to put any CSS code to achieve this layout. The text area should have 10 rows and 80 columns, and the first 2 input text should have a size of 20 and the last one a size of 5. The title should be an h1. Assignment 3 Question 1 Search n this text John ; Doe ; ] d2019"ple. con JaneiDei janeeg0ogle. con Bobi777 bob 777bob.con Splr the text accouding to these chaaces Test each word with this regex: Modifiers for the regex: Search Rese There is a total of 8 non-empty words in the text, including 3 words matching the regex. Computer Science & Software Engineering Concordia University SOEN 287: Web Programming 1 Winter 2019 Assignment 3 All the JavaScript code should be put in the js file, except for connecting the search button with a search function located in the js file, which has to be included in the head element of the html file. Your search function should 1. start by splitting the text from the text area according to the split characters given in the first input text box. If the first input text box is empty, then don't split the text create a regular expression by providing the RegExp constructor function the text of the second and third input boxes (use new RegExp(), not /......) test the regular expression on each non-empty word (or element) of the array obtained from step 1, or on the text directly if no splitting characters were given Output the number of non-empty words in the text, plus the number of words matching the regular expression. 2. 3. 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students also viewed these Databases questions

Question

=+2.23. 1 Extend (2.29) to ordinals & Answered: 1 week ago

Answered: 1 week ago

Question

3. Define the roles individuals play in a group

Answered: 1 week ago