5 ms·
My entry into this category: http://regex.powertoy.org/ http://regex.powertoy.org/ It makes use of a hidden Java applet -- so it supports the somewhat larger
by gojomo 14y ago
My entry into this category:
http://regex.powertoy.org/ http://regex.powertoy.org/
It makes use of a hidden Java applet -- so it supports the somewhat larger Java regex syntax, doesn't send your data anywhere else for matching, and can hook into the string-probing to animate the process. (Click the 'animate?' link to show the animation step/speed controls.)
For example, you can watch the regex that tests whether a number is prime (by failing) or composite (by succeeding) via these two animations:
49: http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24/&syn=perlSyntax&anim=1&rep=&in=1111111111111111111111111111111111111111111111111 http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...
47: http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24/&syn=perlSyntax&anim=1&rep=&in=11111111111111111111111111111111111111111111111 http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...
Is the applet requirement a deal-breaker for casual use? I might be able to feed the OpenJDK 7 regex classes through the Google Java->JS cross-compiler to get a pure-JS solution with the same syntax/animation capabilities.
- zitterbewegung 14y agoI don't think its a deal breaker but if its a hidden java applet then why not have the regexes processed on the server as a servlet and sandbox them with a timeout?
- gojomo 14y agoThat could work, but an original design goal was to avoid server dependencies or bottlenecks. For instant display or the stepwise animation, the lag of a server roundtrip could be a problem; for some users, posting data to a remote service might introduce privacy concerns. (The regex-powertoy can be run completely locally.)
- ibotty 14y agowell. for some it is because they don't run java (e.g. me) but for the large population it will not matter.