cinqmarsmedia / Copy-Editor-A-RegEx-Puzzle-Game

GNU General Public License v3.0
4 stars 1 forks source link

Correct behaviour with spaces #11

Open mpldr opened 1 year ago

mpldr commented 1 year ago

Hello, enjoying the game quite a bit. I do have an issue with a tip that pops up right at the beginning:

To match a whitespace in the "Find" input, use the "\s" token. Traditional spaces are not allowed in "Find" but are in "Replace!".

That is factually incorrect. If I want to match a space, my options are `,\x20,[ ], or variations thereof.\sdoes match whitespace characters, one of which is the traditional , but it also matches\t,\r,\n,\v, and\f. Since the game seems to be using the ECMAScript flavour of Regex, there are actually even more Unicode code points that are matched by\s`.

As this is a learning game, I think this might be confusing when applying what was learnt to the real world and may lead to unexpected footguns.

ccj242 commented 1 year ago

Hey @mpldr, thanks so much for reaching out. You're absolutely right, this is a restriction of the game itself and not of regex and this "lie" is addressed narratively in a later level in the game. I agree it should be addressed here, though.

What if we were to change it to something like:

To match a whitespace in the "Find" input, use the "\s" token. Traditional spaces are not allowed in "Find" (in this game) but are in "Replace!".

We can do this and tweak the chat for the level where we establish that the "system" being used in the game doesn't support the spacebar in the find box?

mpldr commented 1 year ago

It seems, some people aleady have learnt about this issue:

https://steamcommunity.com/id/kickin_eagle/recommended/1489660/ https://steamcommunity.com/id/shrewdlogarithm/recommended/1489660/

ccj242 commented 1 year ago

I will go ahead and make the adjustment I suggested for the next release unless you have any other ideas for how it could be helped? Thanks again!