Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Regular Expression for valid URL :
http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
Regular Expression for valid email address :
/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([com\co\.\in])+$/;
or
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
Explanation :
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
3. Define the regular expression for: (5 points) A valid URL Solution: (5 points) A valid...
1. Use a Regular Expression to define the set of all bit strings of one or more 0's followed by only a 1. 2. Use a Regular Expression to define the set of all bit string of two or more symbols followed by three or more 0's. 3. Are these two grammars the same? a. S-> aSb|ab|λ b. S-> aAb|ab A->aAb|λ 4. Use the process of elimination to find the language of the following FA: (see picture for diagram) 5....
6. (If you cannot get the exact regular expression, put one that is as close as you can. Specify what is wrong with it.)An IP address is often written as four decimal numbers ranging from 0 to 255 with dots between them. For example the database server that we use for this class is 163.238.35.165 a. Write a regular expression that matches IP addresses of this type. You can probably find this answer online, but try to do it yourself...
(a) (5 Points) Construct an equivalent NFA for the language L given by the regular expression ((a Ub) ab)*. Please show the entire construction, step-by-step, to receive full points.
Programming Languages Final Exam Name: Question 1 (15 points) Give a regular expression for each of the following languages over = {0,1,2). 1. All strings that begin with 1 and end with 2. 2. All strings that contain exactly three 1's. For example, "0101012" is valid. 3. All strings in which the digits are non-decreasing. For example, "002" is valid, but "102" is not.
4(10 points] Let A be the language over the alphabet -(a, b) defined by regular expression (ab Ub)aUb. Give an NFA that recognizes A. Draw an NFA for A here 5.10 points] Convert the following NFA to equivalent DFA a, b 4(10 points] Let A be the language over the alphabet -(a, b) defined by regular expression (ab Ub)aUb. Give an NFA that recognizes A. Draw an NFA for A here 5.10 points] Convert the following NFA to equivalent DFA...
3. Given the regular expression (a[b)a(a[b)*. [5 marks] (a) Draw the corresponding NFA diagram using the Thompson construction; (b) Transform the NFA to DFA using subset construction. You need to write the derivation process and draw the resulting diagram; [4 marks] [5 marks (c) Express the RE using a CFG 3. Given the regular expression (a[b)a(a[b)*. [5 marks] (a) Draw the corresponding NFA diagram using the Thompson construction; (b) Transform the NFA to DFA using subset construction. You need to...
(4 points.) Consider the regular expression (11 + 00)'1(e + 01). . Give two strings of O's and 1's, each 6 to 12 characters long, that are both represented by this regular expression . Construct a nondeterministic finite automaton equivalent to the regular expression. (4 points.) Consider the regular expression (11 + 00)'1(e + 01). . Give two strings of O's and 1's, each 6 to 12 characters long, that are both represented by this regular expression . Construct a...
40 points) Use Theorem 5.5.3 and Example 6.1.1 to convert the following regular expression into an NFA-X. Apply the full steps for converting a regular expression to an NFA-X. Do not simplify the machine by removing A transitions or making other changes. Do not construct the machine "directly". For your convenience, it is acceptable to label machines corresponding to segments of the regular expression and use them in subsequent drawings (see class examples). (a Ub)*bba* b*
4.[10 points] Let A be the language over the alphabet E-(a, b} defined by regular expression (ab U b)*a U b. Give an NFA that recognizes A. Draw an NFA for A here. 4.[10 points] Let A be the language over the alphabet E-(a, b} defined by regular expression (ab U b)*a U b. Give an NFA that recognizes A. Draw an NFA for A here.
(1) Write a regular expression for the language. (2) Define a finite state machine (FSM) that recognizes words in the language (input alphabet, states, start state, state transition table, and accept states). Include a state digraph for the FSM. A: For alphabet {p,q,r}, all strings that contain the substring rqr or end with pp.