3 ms·
A question mark (?) is the same as a regular expression dot (.)
- johndoe0815 4y agoI'm not sure why this is posted here, but this seems to be a very special case (the first hit returned for me from Google is a link to qnx). In most common regexps, the ? operator (or \? depending on the variant) indicates that the preceding element is optional (i.e. it can occur once or not at all), whereas the dot implies a single arbitrary character. * GNU sed - https://www.gnu.org/software/sed/manual/html_node/Regular-Expressions.html * perl - https://perldoc.perl.org/perlre * vi(m)/ex - https://learnbyexample.gitbooks.io/vim-reference/content/Regular_Expressions.html * Python - https://docs.python.org/3/library/re.html
- woolion 4y agoThere was much debate around ChatGPT "solving search" by providing a top reply. Some invoked the danger being that the answer might be completely wrong, yet look legit. This is something quite basic that I think can be surprisingly confusing if you need an answer to the question "what does question mark mean in a regex" (this being a query that does give the good answer in Google).