exam questions

Exam 010-160 All Questions

View all questions & answers for the 010-160 exam

Exam 010-160 topic 1 question 67 discussion

Actual exam question from LPI's 010-160
Question #: 67
Topic #: 1
[All 010-160 Questions]

Which operator in a regular expression matches the preceding character either zero or one time?

  • A. ?
  • B. *
  • C. +
  • D. %
  • E. $
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
linglinga
Highly Voted 2 years, 11 months ago
? The preceding item is optional and will be matched, at most, once. * The preceding item will be matched zero or more times. The answer is A. 100%. It is asking zero or ONE time.
upvoted 24 times
...
cyberchick
Highly Voted 3 years ago
I'm assuming the question was not clear or either a tricky question, but this is what I found and would stick with "A" being the correct answer (\? Matches zero or one occurrence of the previous character ). * would be zero or more. Source: https://www.guru99.com/linux-regular-expressions.html
upvoted 7 times
Tocketman
3 years ago
But it clearly states in your source that * matches up zero or more times the preceding character
upvoted 1 times
kimalto452
2 years, 4 months ago
Which operator in a regular expression matches the preceding character either zero or one time?
upvoted 1 times
kimalto452
2 years, 4 months ago
matches the preceding character either zero or one time?
upvoted 1 times
kimalto452
2 years, 4 months ago
zero or one time?
upvoted 1 times
kimalto452
2 years, 4 months ago
ONE time?
upvoted 1 times
...
...
...
...
...
...
AndrewGrasso
Most Recent 2 months, 3 weeks ago
Selected Answer: A
The operator that matches the preceding character either zero or one time is the question mark (?) For example, the regular expression colou?r matches both “color” and “colour”.
upvoted 2 times
...
SilverFox22
3 months, 3 weeks ago
Selected Answer: A
? is used when it is zero or ONE, and * is used for zero or MORE. Thus ? is the answer, since it more precisely matches the question asked. See https://www.geeksforgeeks.org/how-to-use-regular-expressions-regex-on-linux/# and go to 7.
upvoted 1 times
...
Fakenix
7 months, 1 week ago
The question asks "IN A REGULAR EXPRESSION" If you read any documentation, you'll see that the correct answer is A (I mean, the "?")
upvoted 1 times
...
Dever24
11 months ago
Selected Answer: B
https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_04_01.html
upvoted 1 times
...
Router
1 year, 2 months ago
A is the correct
upvoted 1 times
...
DAC3
1 year, 10 months ago
B is the correct answer. Table 4-1. Regular expression operators Operator Effect . Matches any single character. ? The preceding item is optional and will be matched, at most, once. * The preceding item will be matched zero or more times. + The preceding item will be matched one or more times. {N} The preceding item is matched exactly N times. {N,} The preceding item is matched N or more times. {N,M} The preceding item is matched at least N times, but not more than M times. - represents the range if it's not first or last in a list or the ending point of a range in a list. ^ Matches the empty string at the beginning of a line; also represents the characters not in the range of a list. $ Matches the empty string at the end of a line. \b Matches the empty string at the edge of a word. \B Matches the empty string provided it's not at the edge of a word. \< Match the empty string at the beginning of word. \> Match the empty string at the end of word.
upvoted 3 times
...
Temas84
1 year, 11 months ago
Correct answer is B
upvoted 1 times
...
kimalto452
2 years, 4 months ago
Which operator in a regular expression matches the preceding character either zero or one time?
upvoted 2 times
...
Traian
2 years, 4 months ago
B is correct
upvoted 3 times
...
smina
2 years, 8 months ago
The asterisk is used to find something that is repeated 0 or more times. For example, using the expression "[a-zA-Z] \ d *" it will be possible to find both "H" and "H1", "H01", "H100" and "H1000", that is, a letter followed by a undefined number of digits.
upvoted 1 times
...
Tocketman
3 years ago
I would go with B. Literally google it and you will find it.
upvoted 1 times
beazzlebub
2 years, 5 months ago
B is wrong, matches 0 or more times. A is correct, "?" matches zero or one time as is asked in the question.
upvoted 3 times
...
...
h0st
3 years ago
B is the correct answer , ? in cammande line mean that is one character , but * mean a one or r zero or more in the same time
upvoted 2 times
johard
3 years ago
this is correct. * is the correct answer
upvoted 1 times
...
johard
3 years ago
this is correct
upvoted 1 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