Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
radiojosh
on Dec 1, 2023
|
parent
|
context
|
favorite
| on:
The weirdest bug I've seen yet
That was a great read, but there was one thing I didn't understand: Why would the regex string have ".
" twice in a row? What does ".
.
" find that ".
" doesn't find? Does that just mean "at least two characters"?
rjbwork
on Dec 1, 2023
|
next
[–]
It means specifically 2 characters, and is equivalent to .{2}
..+ or ...* are ways of writing "at least two characters".
bn-usd-mistake
on Dec 1, 2023
|
prev
[–]
A single `.` matches exactly one character. `..` matches exactly two characters (not more, not less).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: