regexplanet / regexplanet-nodejs

RegexPlanet's JavaScript backend
https://www.regexplanet.com/advanced/javascript/index.html
GNU Affero General Public License v3.0
2 stars 2 forks source link

Add new XRegExp backend #1

Open slevithan opened 12 years ago

slevithan commented 12 years ago

Are you interested in adding an XRegExp backend (separate from the standard JavaScript backend)? It should be easy to do, since you already support JavaScript with Node.js. You'd probably just need to include XRegExp (var XRegExp = require('xregexp').XRegExp;, after installing with npm), add checkboxes for XRegExp's three nonnative flags (s, x, and n), and use XRegExp.replace/exec/test/split rather than the native methods, for testing.

Actually, since XRegExp compiles to native regexes, you don't even need to use XRegExp.exec/test/split. You do need XRegExp.replace, to use XRegExp's replacement text syntax. You'd probably also want to use XRegExp.exec, so that you get named backreferences on the result array.

If you have any questions or run into any issues, I'd be happy to help.

slevithan commented 12 years ago

@fileformat I see you've added XRegExp support in commit e2333b8ab627217b2404411d64180d197ccd1453, and that the XRegExp version of the tester is now live. That's awesome!

A few issues to report about the XRegExp support, though.

Not specific to XRegExp:

Specific to XRegExp:

Feature requests, specific to XRegExp:

The full list of changes is currently in the roadmap. The release of v3.0.0-final might be delayed for a while since I need to focus on other projects, which is why I think it makes sense to go ahead and upgrade early. Flag A, in particular, would be very useful to test with.

If you have any questions, I'd be happy to help!