m-ender / retina

A regex-based programming language.
MIT License
231 stars 10 forks source link

Match mode option: true/false #5

Closed m-ender closed 6 years ago

m-ender commented 9 years ago

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.

m-ender commented 9 years ago

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.

m-ender commented 6 years ago

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.