Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18205 > unrolled thread

RegExp debugging tool

Started byAsen Bozhilov <asen.bozhilov@gmail.com>
First post2013-01-22 08:40 -0800
Last post2013-01-22 10:00 -0800
Articles 3 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  RegExp debugging tool Asen Bozhilov <asen.bozhilov@gmail.com> - 2013-01-22 08:40 -0800
    Re: RegExp debugging tool Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-22 18:34 +0100
      Re: RegExp debugging tool Asen Bozhilov <asen.bozhilov@gmail.com> - 2013-01-22 10:00 -0800

#18205 — RegExp debugging tool

FromAsen Bozhilov <asen.bozhilov@gmail.com>
Date2013-01-22 08:40 -0800
SubjectRegExp debugging tool
Message-ID<a3084ac0-9d57-49f8-9c6c-5be48f4ae3ba@y8g2000vbb.googlegroups.com>
I developed tool which traces the steps needed by JS regular
expression to find matching substring or fail. It shows step by steps
how the regex is applying on the input data. If the engine performs
step backward aka backtracking, the tool indicates for that. That was
primary goal. I was inspired by RegexBuddy and wanted such tool, but
online. I used BESEN's debug mode of RegExp.

<URL:http://www.regexter.com/>

The tool is still in beta and any suggestions or bug reports are
welcome.
Also I think the FAQ of clj should have a link to this tool.

[toc] | [next] | [standalone]


#18207

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-01-22 18:34 +0100
Message-ID<1653533.WIYo4VKPqX@PointedEars.de>
In reply to#18205
Asen Bozhilov wrote:

> I developed tool which traces the steps needed by JS regular
> expression to find matching substring or fail. It shows step by steps
> how the regex is applying on the input data. If the engine performs
> step backward aka backtracking, the tool indicates for that. That was
> primary goal. I was inspired by RegexBuddy and wanted such tool, but
> online. I used BESEN's debug mode of RegExp.
> 
> <URL:http://www.regexter.com/>
> 
> The tool is still in beta and any suggestions or bug reports are
> welcome.

I do not understand why “f*” would first try to match “f” instead of “fff” 
in “fff”.  ISTM that efficiency of the parser could be greatly improved if 
the latter was the case.  Is this due to BESEN?

I do not know RegexBuddy, but for visualization you should look into Bastian 
Bergerhoff's QuickREx [1].  I have always found the highlighting of 
subexpressions and matching substrings to be useful in Eclipse (and 
fortunately that extension is still working even in Eclipse 4.3 [Kepler] M4; 
the only thing it is lacking is support for ECMAScript RE).

> Also I think the FAQ of clj should have a link to this tool.

Noted for discussion.

[1]
<http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/toc.html>

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#18208

FromAsen Bozhilov <asen.bozhilov@gmail.com>
Date2013-01-22 10:00 -0800
Message-ID<ce5bca24-7318-4dab-9e8a-5a4e5937f839@i1g2000vbp.googlegroups.com>
In reply to#18207
Thomas 'PointedEars' Lahn wrote:

> I do not understand why “f*” would first try to match “f” instead of “fff”
> in “fff”.  ISTM that efficiency of the parser could be greatly improved if
> the latter was the case.  Is this due to BESEN?

The debug mode of the regexter shows what happen internally in BESEN
on each step of evaluating the RegExp. BESEN has different modes of
debug option. It could dump how the particular regex is compiled in
NFA. Based on this dump I am planning in the future to show,
particular subexpression or particular token what match.
Now I print in blue color the processed string and backtracking. I
have to do many things, from highlighting the matched string to that I
mentioned above.

Something important is that, the BESEN has option for maximum step
during the evaluation of the regex. This allows me to handle
catastrophic backtracking. For example you can see:

<http://regexter.com#regexp=%5E(%5BA-Za-z0-9%5C-_~%5C.%5C%2B
%5D*(%25%5B0-9A-F%5D%7B2%7D)*%5B0-9A-Za-z_%5C-%5C.~%5C%2B%5D*)*
%24&flags=&data=www.google.com%20foo>

> I do not know RegexBuddy, but for visualization you should look into Bastian
> Bergerhoff's QuickREx [1].

Thanks for pointing that tool. I will take a look it.


[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web