UNIX and Shell Programming.
Given the regular expression, circle all the matching patterns.
Problem 1. \..\{3\}$
a. rs.ef$tt
b. abc.ab
c. abc.$$$$
d. abc
e. none
Problem 2: :?.?
a. :a?????????
b. eeeeeefffff?hhhh
c. aaa::??????
d. :?.\?
e. none
Problem 3. Write a regular expression that matches a nonblank line.
Please find the following match for regular expressions.
Problem 1. \..\{3\}$
The above regular expression matches pattern ends with "." and any same character occurrence of three.
Answer: none
//its not matching any of the patterns
USER> grep '\..\{3\}$' reg1
Problem 2: :?.?
The above regular expression matches a pattern with":<any character><any character><any character>"
Answer: aaa::??????
USER> grep ':?.?' reg2
aaa::??????
Program 3:
This regular expression -e '^[[:space:]]*$' matches only blank line or lines with spaces/tabs, if we add "-v' to grep then, it will display only the non blank lines
USER> cat reg2
:a?????????
eeeeeefffff?hhhh
aaa::??????
:?.\?
USER> grep -v -e '^[[:space:]]*$' reg2
:a?????????
eeeeeefffff?hhhh
aaa::??????
:?.\?
UNIX and Shell Programming. Given the regular expression, circle all the matching patterns. Probl...
Given the regular expression: ^[ABC][^AB]$ find all the matching patterns (could be more than one): a) A b) AB c) ADBC d) D e) None
Implement a deterministic finite automata (DFA) using C++ programming language to extract matching patterns from a given input DNA sequence string. Design a deterministic finite automata to recognize the regular expression A(A+T+G+C)*A + T(A+T+G+C)*T over the alphaber {A,T,G,C}. This regular expression recognize any string that starts and ends with ‘A’ or starts and ends with ‘T’. Write a program which asks the user to input a DNA sequence. The program should be able to extract all the patterns (substrings present...
1) Write a single line UNIX command to list all sh files matching the multiple conditions below: • at directory "/home/test" • filename containing "exam" 2) Write a single line UNIX command to check if "/home/exam2" in the PATH variable. 3) How to obtain the value of command line arguments in a shell program? 4) Write a single line UNIX command to run an executable Java program Hello at background and output the number of lines in the result. 5)...
Could I get these answered and explained to me? I'm new to
system level programming and rather lost on how to answer or think
through these. I'll definitely provide a thumbs up to those who can
give an explanation along with their answer. Thanks a bunch!
match(es) for expression (maybe each given basic/extended multiple Choose 1. regular no correct match, if no correct option is given then write none as your anser 3), matches or correct and describe the of...
Write a regular expression that matches: a) all strings that end with a dot character ".", without the quotes. b) all strings that begin with a "#" character, without the quotes. c) all floating-point numbers using standard notation (e.g., 12.345 or –12.345). Note that matching numbers may contain any number of digits before or after the decimal point. d) all floating-point numbers using scientific notation (e.g., 1.234e+5 or –1.234E–5). Again, matching numbers may contain any number of digits before or...
In this assignment, you will implement a deterministic finite automata (DFA) using C++ programming language to extract all matching patterns (substrings) from a given input DNA sequence string. The alphabet for generating DNA sequences is {A, T, G, C}. Write a regular expression that represents all DNA strings that contains at least two ‘A’s. Note: assume empty string is not a valid string. Design a deterministic finite automaton to recognize the regular expression. Write a program which asks the user...
Part II: Regular Expression 1. Chose match(es) for each given basic/extended regular expression (maybe multiple correct matches) and describe the pattern of matched string for 3), 4), 5),6), 11) e.g. (ab+a, (extended regex ) a) ababa b) aba c)abba d)aabba e)aa Answer: b,c; Pattern : The matched string should begin and end with 'a and ‘b' occurs at least once between leading and ending ‘a') ote: 1) to 5)are basic regexes 1) 'a[ab]*a' (a)ababa (b) aaba (c) aabab (d) aabbaa...
8.17 python a.) Write a regular expression pattern to match all words ending in s. b.) Write a regular expression pattern to match all words ending in ing. c.) Write a regular expression pattern to match all words with ss anywhere in the string. d.) Write a regular expression pattern to match all words beginning and ending with the letter a. e.) Write a regular expression pattern to match all the words that start with st. f.) Write a regular...
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...