m-ender / retina

A regex-based programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Match mode option: true/false

m-ender opened this issue · comments

Simply print true of false depending on whether a match was possible or not. Ideally this would come with a way to customise the exact strings printed.

Now that stages can be mixed, this can be done manually:

M`regex
^0$
false
\d+
true

It might still be nice to have an option to do this more concisely though.

I don't think I'll implement this. true and false are meaningless in the context of Retina itself and this would only ever be used in programming challenges which strictly require these exact strings regardless of language. Getting a 0 or 1 based on whether a regex matches can be done easily enough with a limit.