Which operator in a regular expression matches the preceding character either zero or one time?
Which operator in a regular expression matches the preceding character either zero or one time?
The operator in a regular expression that matches the preceding character either zero or one time is the question mark (?). This means that the character before ? may appear zero or one time in the string being searched. For example, the regular expression colou?r matches both 'color' and 'colour'.
? 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.
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
But it clearly states in your source that * matches up zero or more times the preceding character
Which operator in a regular expression matches the preceding character either zero or one time?
matches the preceding character either zero or one time?
zero or one time?
ONE time?
B is correct
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.
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
this is correct
this is correct. * is the correct answer
Which operator in a regular expression matches the preceding character either zero or one time?
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”.
I would go with B. Literally google it and you will find it.
B is wrong, matches 0 or more times. A is correct, "?" matches zero or one time as is asked in the question.
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.
Correct answer is B
A is the correct
https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_04_01.html
The question asks "IN A REGULAR EXPRESSION" If you read any documentation, you'll see that the correct answer is A (I mean, the "?")
? 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.