Question

In: Physics

Regular Expressions Assignment Write a regular expression for each of the following. Can you show output...

Regular Expressions Assignment

Write a regular expression for each of the following. Can you show output please.

  1. A blank line (may contain spaces)

  2. Postal abbreviation (2 letters) for State followed by a space and then the 5-digit zip code

  3. A KU student username (Ex. lpork247)

  4. A “valid” email address (also explain how you defined “valid”)

  5. A SSN pattern (ddd-dd-dddd)

Solutions

Expert Solution


Related Solutions

Show that a language that is described by a regular expression can also be generated by...
Show that a language that is described by a regular expression can also be generated by a context-free grammar. As a hint, consider each mechanism, such as using a basic form or forming the regular expression re1 ∪ re2 from the expressions re1 and re2, and show how this can be transformed into grammar rules that can be added to the grammars generating the collection of strings denoted by re1 and re2.
Can you please answer this Automata Question Show how a arbitrary regular expression can by systematically...
Can you please answer this Automata Question Show how a arbitrary regular expression can by systematically turned into a regular grammar. In detail, describe the procedure for producing an equivalent regular grammar.
linux: Regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter...
linux: Regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter the file so the output displays only the items requested. Put your full command in the space provided 1.Show only the lines that end with an ellipses (3 dots) :
linux: regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter...
linux: regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter the file so the output displays only the items requested. Put your full command in the space provided. 1. Display only the lines that were written to the file between the times of 12:55 and 12:59 (inclusive). This is tricky. Don’t think of these times as numbers, think of these times as a series of characters (a 1 followed-by a 2 followed-by a colon,...
linux: regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter...
linux: regular expressions file name: studentsyslog.txt Use a regular expression and grep or egrep to filter the file so the output displays only the items requested. Put your full command in the space provided. 1. Display only the lines that were written to the file between the times of 12:55 and 12:59 (inclusive). This is tricky. Don’t think of these times as numbers, think of these times as a series of characters (a 1 followed-by a 2 followed-by a colon,...
Linux regular expressions: file name: lab3test.txt Create regular expressions that meet the following criteria. You may...
Linux regular expressions: file name: lab3test.txt Create regular expressions that meet the following criteria. You may use grep or egrep to answer these questions. 1.Match any lines that contain a phone number with the format 222-222-2222.
linux Regular expressions file name: lab3test.txt Create regular expressions that meet the following criteria. You may...
linux Regular expressions file name: lab3test.txt Create regular expressions that meet the following criteria. You may use grep or egrep to answer these questions. 1.Display all lines where the employee’s age is greater than 40 years old. Again, don’t think of this as a number, think of it as a series of characters.
. Give an example of a string represented by each of the following regular expressions •...
. Give an example of a string represented by each of the following regular expressions • 0+ 1+ (11)* 0? • [0-9]+ ( (E|e) (\+|\-)? [0-9]+ )? • ([a..z] ([a..z] | [0..9])*)
1. What is a regular expression? Write a regular expression that will detect “College” and “collegE”....
1. What is a regular expression? Write a regular expression that will detect “College” and “collegE”. 2. What is degree centrality? Create a graph of 4 vertices and compute the degree centrality of the vertices. 3. Compute internal and external community densities for a graph containing 6 nodes. You can create any graph of 6 nodes with at least 4 edges.
For each of the following Perl regular expressions, give a complete and precise description of the...
For each of the following Perl regular expressions, give a complete and precise description of the function of the regular expression, plus a related example string: (a) /"([^"]*)"/ (b) /[-+]?\d+(\.\d*)?F\b/ (c) /(\D{2,}).*\[\1\]/ (d) /((.*?)\d)\s\2/ (e) /^[0-9]+\/\d+([+\-*\/]\=|([+]{2}|[-]{2}));$/
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT