---UNIX--
Which of the following regular expressions will NOT match any part of the following line;
The ASU Solution center can be reached 24/7 at; 1(855) 278-5080
| .+ |
| ([0-8]+) |
| ([0-9]{3}) [0-9]{3}-[0-9]{3} |
| [0-9\(\)\- ]+ |
The regular expression which will not match any part of the given line is ([0-9]{3}) [0-9]{3}-[0-9]{3}
The reason behind it is as follows:
Hence, the regular expression won't match any part of the given line.
---UNIX-- Which of the following regular expressions will NOT match any part of the following line;...
The purpose of this lab assignment is to practice searching in Unix and using regular expressions. Task A: Use the find command to find all directories under /pub/cs/ whose name is cs160a. Be sure to only display the results that match, do not display any error output. Hint: use: 2>/dev/null. Task B: Create a one-line command, using he famous.dat file, to add the word " STREET" to the address, for all who live on 2nd or 3rd. For example: '2nd'...
For each of the following pairs of regular expressions and strings, indicate the reason that the string does not match the regular expression Regular Expression String Reason for mismatch AbCdEfG AbCdefG [A-Z][a-zl*! CamelCase! Abc\.def Abcxdef 4 qwqwqwqX 6.I-11-90-9) [A-Z][A-Zlla-z] Xpp 8 Ovla-ZA-ZO-9]+ Ovalpha-bet3 [aeiou][a-z]*[A-Z]ayrunAway 10. [a-c-((de)l(fg))? m-defg
1. Write regular expressions to capture the following regular languages: (a) The set of binary strings which have a 1 in every even position. (Note: odd positions may be either 0 or 1.) (b) The set of binary strings that do not contain 011 as a substring. (c) Comments in Pascal. These are delimited by (* and *) or by { and }, and can contain anything in between; they are NOT allowed to nest, however. 2. Write a DFA...
4. Write regular expressions that match the descriptions given below. (10 P Description A sequence of digits of any length that also contains the sequence of four letters "meow", in that order, anywhere in the Expression sequence. A sequence of zero or more x's and y's, OR zero or one z's. 3 The American word color, or the British spelling (colour). Your answer can NOT include an or. 4 A string that begins with an X and ends with an...
Purpose: Gain experience converting from finite automata to regular expressions. Give regular expressions generating the following languages over {0,1}. Do these by hand by converting the finite automata. In your answers, you may use the shorthand Σ = (0+1) a. {w | w does not contain the substring 110} b. {w | w is any string except 11 and 111}
Preliminaries For this lab you will be working with regular expressions in Python. Various functions for working with regular expressions are available in the re module. Fortunately, Python makes it pretty easy to check if a string matches a particular pattern. At the top of the file we must import the re module: import re Then we can use the search() function to test whether a string matches a pattern. In the example below, the regular expression has been saved...
Describe in plain english what the following regular expressions match: ab+c [A-Z][0-9]{6} \d+ ([A-Z][a-z]+)+\n([A-Z][a-z]+)+,[A-Z]{2} \d{5}\ Write a finite state machine for each of the previous regexs.
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,...
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)...
3. Create a CFG describing regular expressions over the alphabet {0, 1}. You will need to quote the regular expression operators and the template given you has them quoted as terminals. We expect the grammar to generate the following syntactic constructions: • Union via "|", for example, 0 1 "|" 1 should be in the language generated by the grammar • Intersection via "&", for example, 0 1 "&" 1 should be in the language • Concatenation: any nonempty sequence...