Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I fed it a favorite regex... Bravo. Unfortunately, the permalinking fails with this particular regex, or I'd include it here. The visualization is so large, it more than fills my large screen. Still, pretty cool to see it render instantaneously and to watch it match example text. The regex is described here: http://www.cs.sfu.ca/~cameron/REX.html It will match either text or XML markup (it's used to tokenize XML), so try example text like '<div id="123">abc' or 'abc<?xml target?>'.

The JavaScript form of the regex follows: [^<]+|<(!(--([^-]-([^-][^-]-)->?)?|\[CDATA\[([^]]]([^]]+])]+([^]>][^]]]([^]]+])]+)>)?|DOCTYPE([ \n\t\r]+([A-Za-z_:]|[^\x00-\x7F])([A-Za-z0-9_:.-]|[^\x00-\x7F])([ \n\t\r]+(([A-Za-z_:]|[^\x00-\x7F])([A-Za-z0-9_:.-]|[^\x00-\x7F])|"[^"]"|'[^']'))([ \n\t\r]+)?(\[(<(!(--[^-]-([^-][^-]-)->|[^-]([^]"'><]+|"[^"]"|'[^']')>)|\?([A-Za-z_:]|[^\x00-\x7F])([A-Za-z0-9_:.-]|[^\x00-\x7F])(\?>|[\n\r\t ][^?]\?+([^>?][^?]\?+)>))|%([A-Za-z_:]|[^\x00-\x7F])([A-Za-z0-9_:.-]|[^\x00-\x7F]);|[ \n\t\r]+)]([ \n\t\r]+)?)?>?)?)?|\?(([A-Za-z_:]|[^\x00-\x7F])([A-Za-z0-9_:.-]|[^\x00-\x7F])(\?>|[\n\r\t ][^?]\?+([^>?][^?]\?+)>)?)?|/(([A-Za-z_:]|[^\x00-\x7F])([A-Za-z0-9_:.-]|[^\x00-\x7F])([ \n\t\r]+)?>?)?|(([A-Za-z_:]|[^\x00-\x7F])([A-Za-z0-9_:.-]|[^\x00-\x7F])([ \n\t\r]+([A-Za-z_:]|[^\x00-\x7F])([A-Za-z0-9_:.-]|[^\x00-\x7F])([ \n\t\r]+)?=([ \n\t\r]+)?("[^<"]"|'[^<']'))*([ \n\t\r]+)?/?>?)?)



Wow. How the hell do you (OP) get it to render so fast? That was instantaneous as far as I could tell. I've seen websites take 5x as long to add a <li> to a <ul> ... I'm really amazed.


Heh, your browser does most of the hard stuff :) I'm not quite sure what others are doing that it's slow.


I'm stunned. I was expecting it to chug with something like that, but nope, instant.


You're not kidding; it is virtually instantaneous in Chrome, IE9 & Firefox.


Even on my AMD E-450 netbook, that was pretty much instant. Lagged a lot afterwards (to be expected, running FF on elementary Luna), but way better than I thought it would! Well done OP, seriously well done.


Perhaps it has something to do with using SVG rather than just HTML elements?


The permalinking is very rudimentary and was put up quickly so that it worked for "most cases". I wanted to focus on building the actual debugger. This will be fixed in the near future.


Op, have demonstrated your expertise. Nicely done. Thanks jdnier for the example.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: