Exam 7: Working With Regular Expressions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following String methods can be used to substitute the first instance of a search pattern within a string?

Free
(Multiple Choice)
4.8/5
(31)
Correct Answer:
Verified

A

The most basic type of regular expression is one that matches up against a specific pattern or a set of characters. This type of pattern can be set up using the {} match operator.

Free
(True/False)
4.7/5
(39)
Correct Answer:
Verified

False

The \A character is used in a regular expression to look for a match at the beginning of a string.

Free
(True/False)
4.8/5
(33)
Correct Answer:
Verified

True

Data processed by computer scripts can come from many different sources, including ____.

(Multiple Choice)
4.8/5
(44)

The . character is used in a regular expression to look for a match at the beginning of a line.

(True/False)
4.8/5
(35)

The \D character is used in a regular expression to look for a match with any numeric character.

(True/False)
4.9/5
(38)

Using regular expressions you can define patterns that ____.

(Multiple Choice)
4.9/5
(29)

The ____ metacharacter modifier is used to search a string for one or more instances of a character.

(Multiple Choice)
4.7/5
(35)

Which of the character classes can be used to match a number between 0 and 9?

(Multiple Choice)
5.0/5
(41)

Which of the following is true about regular expressions?

(Multiple Choice)
4.7/5
(41)

Which of the following statements is true in regard to the following example? if "Welcome the USA!." =~ /USA|America/ then puts "We have a match!" end

(Multiple Choice)
4.9/5
(38)

The =~ operator is the "not equals to" operator in a regular expression.

(True/False)
4.8/5
(33)

Which of the following operators should be used in a regular expression to determine equality?

(Multiple Choice)
4.8/5
(29)

Which of the following regular expression metacharacters looks for a match at the beginning of a line?

(Multiple Choice)
4.9/5
(43)

Which of the following regular expression metacharacters matches any non-alphabetic, non-numeric, or non-underscore character?

(Multiple Choice)
4.7/5
(49)

You can validate data using regular expressions. However, to truly create powerful validation routines, you should instead rely on conditional logic and methods belonging to Ruby classes.

(True/False)
4.8/5
(37)

Which of the following regular expression metacharacters looks for a match at the end of a line?

(Multiple Choice)
4.9/5
(38)

Character classes are used to search for a range of characters and are defined by placing a list of characters within ____ characters.

(Multiple Choice)
4.8/5
(42)

Using regular expressions, you can pick apart and process the contents of data regardless of its source, including text files and databases.

(True/False)
4.8/5
(36)

Using regular expressions, you can perform detailed analysis of user input to determine if it meets specific criteria.

(True/False)
4.9/5
(35)
Showing 1 - 20 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)