Contributions are welcome. Please follow the standard Github pull request flow.
If you want to add support for a new regex engine, you need to do this is a separate repo.
The existing regex backends are on Github and a good place to start. Note: I am not an expert at all of the languages, so the code can definitely be sub-optimal.
Once you have a working backend, you need to host it somewhere. If you have it Docker-ized, I take it from there and host it with the other backends.
You can try your engine by adding a testurl
parameter to the query string of the test page. I.e. something like:
https://www.regexplanet.com/advanced/perl/index.html?testurl=http://localhost:8080/test.pl
These are the API endpoints RegexPlanet uses to communicate with each backend regex engines.
Note: the endpoints must support both JSON and JSONP. The JSONP version takes a callback
parameter in the query string.
Input:
callback
- the name of the JSONP callback function. This is the only parameter not visible in the page source. This will not be present for browsers (cough MSIE cough) that do not support CORS. They get get proxied instead.regex
- the regular expressionoption
- options that are set (can be multiple, see the current list)replacement
- replacement string.input
- text to test against (can be multiple)
Note that multiple parameters do not have any special suffixes (i.e. [0] or whatever). Web frameworks will just have to deal.
Output:
success
- boolean, true only if no errorshtml
- html to display on the page
This will be displayed on the status page.
Input:
- (none)
Output: JSON map of any items of interest. Mandatory items:
success
- boolean, true only if no errorsversion
- String, human-readable version information. Do not includeshort_name
.
/
- should redirect to the testing page/favicon.ico
/favicon.svg
/robots.txt
/humans.txt
- optional, if you want to take some credit
Add a new RegexEngine in src/engines
. You can use empty.ts
as a starter.