? 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
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”.
? 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.
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.
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.
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.
linglinga
Highly Voted 2 years, 11 months agocyberchick
Highly Voted 3 years agoTocketman
3 years agokimalto452
2 years, 4 months agokimalto452
2 years, 4 months agokimalto452
2 years, 4 months agokimalto452
2 years, 4 months agoAndrewGrasso
Most Recent 2 months, 3 weeks agoSilverFox22
3 months, 3 weeks agoFakenix
7 months, 1 week agoDever24
11 months agoRouter
1 year, 2 months agoDAC3
1 year, 10 months agoTemas84
1 year, 11 months agokimalto452
2 years, 4 months agoTraian
2 years, 4 months agosmina
2 years, 8 months agoTocketman
3 years agobeazzlebub
2 years, 5 months agoh0st
3 years agojohard
3 years agojohard
3 years ago