Use regular expressions in commands and scripts read help


Goal

Use regular expressions in commands and scripts. Read help on Windows command findstr and Linux utility grep. Use grep with option -P.

Output

Complete the following tasks and submit it to the correlating assignment submissions folder. Supply screenshots to support your answers.

Procedure

Complete the following tasks.

Tasks

  1. Write a regex that matches email in the following format: [email protected] (name may contain letters, digits, underscores, dashes and periods; domain contains the same minus underscores; tld is a top-level domain).
  2. Example: [email protected] is a valid email
  3. Example: [email protected] is invalid (tld is invalid, too long)
  4. Write a regex that matches email in the following formatS: [email protected], name @ uiu.edu, name at uiu dot edu (in each case name may contain no more than 1 period).
  5. Write a Windows script, pipe or command that prints a line from the file sciencemath.html that contains my last name (Yasinovskyy).
  6. Write a Windows script or a pipe that finds all lines of a sciencemath.html that contain an email and saves them to a file harvest.txt (saved lines may contain other text, not just email).
  7. Write a Windows script or a pipe that counts number of Science and Math faculty emails (hint: use findstr and find).
  8. Write a Windows script that asks what file ([A]rts, [B]usiness, [E]ducation, [S]cience) a user wants to process and prints number of email addresses in that file.
  9. Write a Linux script or a pipe that prints names of Science and Math faculty.
  10. Write a Linux script or a pipe that prints emails of all UIU faculty and saves them (emails only) to a file harvest.txt.
  11. Write a Linux script that takes any faculty name as an argument and prints school affiliation of that person person's email (process all 4 files).
  12. Write a Linux script that takes any faculty name as an argument and prints that person person's email (process all 4 files).

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Use regular expressions in commands and scripts read help
Reference No:- TGS02340087

Now Priced at $25 (50% Discount)

Recommended (95%)

Rated (4.7/5)