Open beyarkay opened 2 years ago
The major blocker for this is CPU. This is quite an expensive operation, and the server would likely not be able to handle this additional load. On top of that, the current output from the explanation isn't very "api/cli friendly", which means it'd have to be reworked quite a bit.
I wonder of a regex101 REST API would be a more generic approach. This could start with a simple way to test expressions against input. The explainer text could be more easily structured into a json response possibly. Just an idea. One that may be commercially viable as you may wish to charge or only allow the API to be used under certain conditions.
Feature
Hi! I love the website, use it multiple times a week to check my regex. Often my workflow is that I'll write regex, paste it into the website, and check some test cases or check the explainer to see that I haven't left anything unescaped or similar.
It would be amazing if I could curl against the website and get back a formatted explainer of the regex, similar to how cheat.sh will explain bash commands via
curl http://cheat.sh/pwd
. Something like:This means that from the commandline I can directly paste explainers of complicated regex as comments into my code which would be super useful.
There would be some trickery to escaping regex characters in the URL, but I'm happy to help out if this feature is put on the roadmap.
For reference
This is how cheat.sh works:
It also colour codes the various parts, but that's more of a nice-to-have