exam questions

Exam CIS-SM All Questions

View all questions & answers for the CIS-SM exam

Exam CIS-SM topic 1 question 26 discussion

Actual exam question from ServiceNow's CIS-SM
Question #: 26
Topic #: 1
[All CIS-SM Questions]

Which one of the following best represents the output from the following Regular Expression?
([\w\d\-\.]+)

  • A. Match a single character in the list between one and unlimited times.
  • B. Match a single character in the list one time.
  • C. Match a single character in the list between one and three times.
  • D. Match a single character in the list between one and ten times.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
LeoSu
8 months, 1 week ago
The correct answer is: A Explanation: [\w\d\-\.] matches any word character, digit, hyphen, or period. The + after the character class indicates that the character in the list can appear one or more times. So, the regular expression ([\w\d\-\.]+) will match one or more occurrences of word characters, digits, hyphens, or periods.
upvoted 2 times
...
frankgerv
8 months, 2 weeks ago
[\w\d\-\.] is a character class that matches any single character that is either a word character (\w), a digit (\d), a hyphen (\-), or a period (\.). \w: Matches any word character, which includes letters, digits, and underscores. \d: Matches any digit. \-: Matches a hyphen character. The hyphen is escaped with a backslash because it is a special character in regular expressions. \.: Matches a period character. The period is also escaped with a backslash. + is a quantifier that indicates the preceding character class ([\w\d\-\.]) should appear one or more times. In other words, it matches one or more of the specified characters.
upvoted 3 times
...
ParagSanyashiv
10 months, 3 weeks ago
Selected Answer: A
A is correct answer
upvoted 2 times
...
snowblind
1 year, 2 months ago
Selected Answer: A
The + lets it match one or more. Try it out on regex101.com
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago