Question

In: Computer Science

Write a regular expressions that would match lines in text that contain word DATE: at the...

  1. Write a regular expressions that would match lines in text that contain word DATE: at the beginning of a line followed by actual date in format YYYY-MM-DD. Space between colon ( : ) and date may or may not exist.
  2. In C, if you issue the following statement n << 2 where n is an integer, what will be value of n?
  3. In bash, if you define variable var = “date” and issue a statement echo `$var`, what output will you get?
  4. In bash script, if you issue command read a b c d and enter 1 22 3 44 5 66 7 88, what variables a, b, c, and d contain?
  5. If you want to redirect output of a bash command into a file what operator will you use?
  6. What does operator | mean in bash?
  7. What variable $0 contains in gawk?
  8. What variable $0 contains in bash script?
  9. What the statement esac means in bash script?
  10. If you would define a rule for creating a variable in C using regular expression, how would you write it?
  11. If you need to skip statements in for or while loops and go to the next iteration, what statement will you use?
  12. In respect to users and processes, how would you define Linux OS?
  13. What the following regular expression means (\*|~){1,} ?
  14. You friend notifies you that feature1 branch you are working on currently is updated on a GitLab server. What git command will you use to bring the updates to your local environment?
  15. You want to replace all words people with students in file Lecture1. What sed command will you use?

Solutions

Expert Solution

For no space between colon (:) you can use \b(DATE)\b:\d{4}-\d{2}-\d{2} .If there is space between colon(:) simply put \s for space, therefore it becomes \b(DATE)\b\s:\s\d{4}-\d{2}-\d{2} .

You can use the table below to further modify your expression/pattern.

THUMBS UP IF YOU LIKE IT !


Related Solutions

Write a regular expressions that would match lines in text that contain word DATE: at the...
Write a regular expressions that would match lines in text that contain word DATE: at the beginning of a line followed by actual date in format YYYY-MM-DD. Space between colon ( : ) and date may or may not exist. In C, if you issue the following statement n << 2 where n is an integer, what will be value of n?
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. A blank line (may contain spaces) Postal abbreviation (2 letters) for State followed by a space and then the 5-digit zip code A KU student username (Ex. lpork247) A “valid” email address (also explain how you defined “valid”) A SSN pattern (ddd-dd-dddd)
QUESTION: Write regular expressions after the ► to validate the following inputs: a) Product codes that...
QUESTION: Write regular expressions after the ► to validate the following inputs: a) Product codes that have one or more letters followed by one or more digits. ► b) Nonnegative integers between 1,000 and 9,999, including the comma. ► c) Canadian zip code containing upper case characters only. ► d) License plate numbers that have the form:          Letter          Digit          Letter          Hypen (-)          Digit          Letter          Digit ►
Write a program to convert a text-file containing expressions (one per line) into post-fix expressions outputted...
Write a program to convert a text-file containing expressions (one per line) into post-fix expressions outputted to a file of your choice using a stack with one space between operators and variables (one letter variables) and/or constants (one digit constants). IN PYTHON please
Write a program to convert a text-file containing expressions (one per line) into post-fix expressions outputted...
Write a program to convert a text-file containing expressions (one per line) into post-fix expressions outputted to a file of your choice using a stack with one space between operators and variables ( one letter variables) and/or constants (one digit constants).
The user is going to cin a whole bunch of regular text. You store each word...
The user is going to cin a whole bunch of regular text. You store each word based on its first letter. Print out all the words they used by letter. Strip all punctuation and uncapitalize everything. : - Project set up with stl includes, correct files, and turned in correctly. (Zipped project with no inner debug folder.) - Basic data structure made. This requires at least two connected containers. More is okay if it makes sense to you, but no...
Question d) Write the regular expression statement that will match a string that starts with the...
Question d) Write the regular expression statement that will match a string that starts with the word "Warning" following by one space and then a number of any number of digits. Question e) Write the regular expression statement that will match a string that ends with the phrase "End of Report. Question f) Write the regular expression statement that will match a string that starts with the phrase "Begin Log:" then contains a collection of characters (other than newline) followed...
Write a Java program that will test lines of text to see if they are palindromes....
Write a Java program that will test lines of text to see if they are palindromes. The program should prompt the user for the name of a file to process, then open and read the file of possible palindromes (one per line of text). The program should then print the total number of lines read, and total number of palindromes.
Write a program that allows the user to navigate the lines of text in a file....
Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the program...
Write a program that allows the user to navigate the lines of text in a file....
Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the program...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT