Live data from Hacker News

RegExr: A website for interactive regex prototyping with syntax highlighting

regexr.com

41–50 of 72 posts

Re: RegExr: A website for interactive regex prototyping with syntax highlighting

#42
post #36

Unfortunately, RegExr does not color-code the different capturing groups. For example, replace the RegExr sample regex with "([A-Z])\w+\s\w(\d.\d)" and compare[1][2] its color coding capability to the other regex helpers. The other sites such as regex101.com & debuggex.com will delineate the capture groups within the matched text using different colors. This is very helpful for complex captures because making the bou…

this seems incredibly easy to add given what they're done - just send a note to the author. I can't imagine how it wouldn't take seconds to implement.

It is actually true for PCRE (PHP), Python, and and a bit for non-global Javascript regex. For global matches in JS it is, I dare to say, incredibly difficult, if not impossible. I haven't seen visualised submatches in JS anywhere. I'd be happy to be mistaken and corrected.

So go on, try it right away :] I think it might be possible to get it done with breaking original regexp into group tree and look what each part did on concrete match from global search using non-global match on local instances. You'd need own regex parser and watch out for deep nesting.

Re: RegExr: A website for interactive regex prototyping with syntax highlighting

#43
post #34

I had the older version bookmarked http://gskinner.com/RegExr/ which now redirects to this site. Some other good sites that I've used are: http://regviz.org/ https://regex101.com/ http://osteele.com/tools/rework/ http://www.rexv.org/ https://www.debuggex.com/

I'd add http://regexpal.com/ for historical completeness. It's the first such tool I used and prefer it even today. Very sad that from what it seems Steven Levithan sold entire domain recently and is not updated anymore. Even permalinks broke last year. (I'm a bit worried, what's up with Steven.)

Re: RegExr: A website for interactive regex prototyping with syntax highlighting

#45
post #44

http://regexp.quaxio.com/ tries to act as a linter.

That's a great project by @amenghra and Facebook's Hack creator Julien Verlaguet! Don't know if it made HN when it was released.

Oh wow, always cool to see stuff Julian has done!

Re: RegExr: A website for interactive regex prototyping with syntax highlighting

#47
post #42

Earlier quoted context omitted.

this seems incredibly easy to add given what they're done - just send a note to the author. I can't imagine how it wouldn't take seconds to implement.

It is actually true for PCRE (PHP), Python, and and a bit for non-global Javascript regex. For global matches in JS it is, I dare to say, incredibly difficult, if not impossible. I haven't seen visualised submatches in JS anywhere. I'd be happy to be mistaken and corrected. So go on, try it right away :] I think it might be possible to get it done with breaking original regexp into group tree and look what each part…

Then I think I misunderstood what jasode was asking. Specifically, the example (our link) already names groups if you hover over matching text (group #1, etc) - I thought they were just asking for the highlight color to correspond to the group # listed.

Re: RegExr: A website for interactive regex prototyping with syntax highlighting

#49
post #42

Earlier quoted context omitted.

It is actually true for PCRE (PHP), Python, and and a bit for non-global Javascript regex. For global matches in JS it is, I dare to say, incredibly difficult, if not impossible. I haven't seen visualised submatches in JS anywhere. I'd be happy to be mistaken and corrected. So go on, try it right away :] I think it might be possible to get it done with breaking original regexp into group tree and look what each part…

Then I think I misunderstood what jasode was asking. Specifically, the example (our link) already names groups if you hover over matching text (group #1, etc) - I thought they were just asking for the highlight color to correspond to the group # listed.

Thanks for mentioning the tooltip popups. I didn't realize RegExr used mouseover/hover events on the matching text since the other regex sites don't do that. (It seems like non-obvious UX/UI but I now notice that the bottom left corner does say "Roll over a match or expression for details" -- but who reads the instructions?!?! Nobody's got time fo 'dat.)

Nevertheless, I prefer explicit color-coding highlighting the boundaries instead tooltips displaying the offset numbers.

Re: RegExr: A website for interactive regex prototyping with syntax highlighting

#50
post #49

Earlier quoted context omitted.

Then I think I misunderstood what jasode was asking. Specifically, the example (our link) already names groups if you hover over matching text (group #1, etc) - I thought they were just asking for the highlight color to correspond to the group # listed.

Thanks for mentioning the tooltip popups. I didn't realize RegExr used mouseover/hover events on the matching text since the other regex sites don't do that. (It seems like non-obvious UX/UI but I now notice that the bottom left corner does say "Roll over a match or expression for details" -- but who reads the instructions?!?! Nobody's got time fo 'dat.) Nevertheless, I prefer explicit color-coding highlighting the b…

yes, I only knew about the hovering because of the instructions, which I did read. FWIW, my reaction was it would probably be better if they were all visible at once, who has time to hover over stuff.

anyway since they have the logic to already know what to put in the tooltip, making that number determine a color seems like it would be simple, almost as simple as appending it to the tooltip. (if indeed that's all that's missing.)

email the author your suggestion :)

Post reply on HN