Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
lilyball
4 months ago
|
parent
|
context
|
favorite
| on:
A minimax chess engine in regular expressions
assign_pop() is implemented a bit oddly. In particular, the second regex starts off with
(%%)([^`]\n?#stack:\n)
This should have just been written like the following (which in fact eq() does do, though eq() is itself missing the %%` -> %% regex):
(%%)(\n#stack:\n)
As it is the [^`] matches the newline, which is why the \n has to be marked as optional and in practice will always be skipped.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: