Let digit be [0-9] what does the following regular expression
defines in Unix?
a). [-]?(({digit}+)|({digit}*\.{digit}+)([eE][+-]?{digit}+)?)
b). [-+]?{digit}+
c). Give two examples for each of the above.
a)
[-]?(({digit}+)|({digit}*\.{digit}+)([eE][+-]?{digit}+)?)
Let me explain in parts -
[-]? -> 0 or 1 occurrence of '-'
({digit}+)|({digit}*\.{digit}+) -> {digit}+ -> 1
or more occurrence of digits
| -> OR
{digit}*\.{digit}+ -> 0 or more occurrence of digits
followed by a '.' and one or more occurrence of digits
([eE][+-]?{digit}+)? -> [eE][+-]? -> 'e' or 'E' followed by
either (+ or -)(0 or 1 occurrence)
{digit}+ -> 1 or more occurrence of digits
? -> 0 or 1 occurrence of ([eE][+-]?{digit}+)
Example - 1, .9, 0.2, 7e9, 7e-9, 7e+9, 0.2E+9
Basically, it is representation in exponential form with the e part
may or may not exist
b) [-+]?{digit}+
It is simply representation of integers that is (+ or -)(0 or 1
occurrence) followed by at least 1 digit.
Example - 1,+1,-1
Let digit be [0-9] what does the following regular expression defines in Unix? a). [-]?(({digit}+)|({digit}*\.{digit}+)([eE][+-]?{digit}+)?) b)....
create a regular expression in Java that defines the following. A "Stir" is a right brace '}' followed by zero or more lowercase letters 'a' through 'z' and decimal digits '0' through '9', followed by a left parenthesis '('.
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...
roblem 18 [15 points Consider the Turing M (Q,E, T,6,4, F), such that 16 g transition set (d) Write a regular expresion that defitves L. fsuch a regular expression does mot exist, prove it Answer: E, N,t,1, R (M has an one-way infinite tape (infinite to the right only.) B is the designated blank symbol. M accepts by final state.) Let L be the set of strings which M accepts Let LR be the set of strings which M rejects....
Under Unix C-shell environment, you can create variables using either set or setenv. What is the difference between these two types of variables? Does Python have array type? Why or why not? Give some reasoning. Create a class for watch with at least two method Create two subclasses for mechanical watch and solar watch. Create at least two methods for each subclass. Write regular expression to match scientific notation numbers. Your regular expression coefficient can be either integer or float.
I'm not sure how to answer this problem. Can someone help me with this. thanks 5. Let M be the Turing machine BIBR 9 9 ala R a) Give a regular expression for L(M. b) Using the techniques from Theorem 10.1.3, give the rules of an unrestricted gram- mar G that accepts L(M. c) Trace the computation of M when run with input bab and give the corresponding derivation in G. 5. Let M be the Turing machine BIBR 9...
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.
Finite Automata and regular Expression Given the following Finite automata: 1. 0, 1 0, 1 0, 1 What regular expression does it accept?
For each of the following regular expressions, give two strings that are members and two strings that are not members of the language described by the expression. The alphabet is ∑ = {a, b}. a(ba)∗b.(a ∪ b)∗a(a ∪ b)∗b(a ∪ b)∗a(a ∪ b)∗. (a ∪ ba ∪ bb)(a ∪ b)∗.
Regular Expression processor in Java Overview: Create a Java program that will accept a regular expression and a filename for a text file. The program will process the file, looking at every line to find matches for the regular expression and display them. Regular Expression Format The following operators are required to be accepted: + - one or more of the following character (no groups) * - zero or more of the following character (no groups) [] – no negation,...
please Answer the following regular expressions questions(also do number 9) Q4 Choose the pattern that finds all filenames in which the first letters of the filename are astA, followed by a digit, followed by the file extension .txt. 1) astA[[:digit:]]\.txt 2) astA[[0-9]].txt 3) astA.\.txt 4) astA[[:digit:]].txt Q5 What's the difference between [0-z]+ and \w+ ? 1) The first one accepts 0 and z and the other doesn't. 2) The first one doesn't allow for uppercase letters. 3) The first one...