Live data from Hacker News

RegExr: A website for interactive regex prototyping with syntax highlighting

regexr.com

61–70 of 72 posts

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

#61
post #56
post #21

Earlier quoted context omitted.

I use RegexBuddy, it has a shitload of different modes.

I love and miss RegexBuddy! If only they had a Mac/Linux version :( I've had thoughts about switching back to Windows while developing complex regular expressions.

Regexbuddy can be run on a Mac using Wine.

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

#62
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…

Interesting, somehow I just instinctively moused over the text when I first visited the page. Another example of the subjectivity of UX and need for UI to be explicit and versatile I guess.

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

#63
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…

Just wanted to chime in and give my recommendation for regex101.com that parent links to. This is by far the best regex "composer" I have ever used, on or offline.

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

#64
post #59
post #57

Earlier quoted context omitted.

Author of Debuggex here. Debuggex actually has the /g flag always enabled (the example above happened to have just one match), and it works for JS [1]. Groups for JS are indeed quite tricky. However, they come for free if you implement state visualization, since you need your own regex engine to do that (and can use said engine for the position of groups). [1]: https://www.debuggex.com/r/wSCkdE0_MNrysz4x

In my examples, it looks like debuggex didn't match "\s" to newline in "...Z\n0..." but regex101.com does. I don't know if that behavior for not matching newline matching is desirable since "\s" is supposed to include [ \t\r\n\f]. (See [1]) In any case, there doesn't seem to be an option in debuggex to make it behave like regex101 for my specific example. [1] http://www.regular-expressions.info/shorthand.html

Ah, you're likely on a Windows machine. Debuggex will terminate lines depending on your system. So you would need \s\s to match both \r and \n

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

#65
post #64
post #59

Earlier quoted context omitted.

In my examples, it looks like debuggex didn't match "\s" to newline in "...Z\n0..." but regex101.com does. I don't know if that behavior for not matching newline matching is desirable since "\s" is supposed to include [ \t\r\n\f]. (See [1]) In any case, there doesn't seem to be an option in debuggex to make it behave like regex101 for my specific example. [1] http://www.regular-expressions.info/shorthand.html

Ah, you're likely on a Windows machine. Debuggex will terminate lines depending on your system. So you would need \s\s to match both \r and \n

Interesting. That's very subtle behavior. (Especially since it sometimes fools one into thinking /g option is not enabled when in reality, it's a CR+LF issue.)

I'm not saying your site's interpretation of Windows CR+LF is "wrong" but the other 5 online[1] regex testers don't behave that way on Windows Chrome browser. I also tested the regex and target text on desktop JGSoft RegexBuddy[2]. None of those required "\s\s" instead of "\s".

Debuggex at the least, is very idiosyncratic since the majority of the other testers don't treat CR+LF that way.

[1]regex testers tried with "([A-Z])\w+\s\w(\d.\d)" on Windows:

http://regexr.com/3b22q

http://regviz.org/

http://www.rexv.org/

https://regex101.com/r/eB5jY1/1

https://www.debuggex.com/r/mci3WLNmHGTEatf6

[2]http://i.imgur.com/t2L04mO.png

(http://www.regexbuddy.com/)

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

#67
post #29
post #4

Nice work :) Looks like this tool puts the emphasis on the pedagogical aspect. For development, the most fantastic tool that I know of in this space is debuggex. Here is an example with roman numbers: https://www.debuggex.com/r/Xqlv3QcAuw_EgPSM

Dude, that is way cool. This is like one step away from FSMs.

You can step through the FSM on Debuggex by using the sliders :)

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

#69
I've been looking for something like this on mac since I moved away from windows long time ago, no RegEx Buddy, such a great tool too. I think that I discovered regexr a year ago. This is such a great tool. Much appreciated work from @gskinner and community.

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

#70
post #65
post #64

Earlier quoted context omitted.

Ah, you're likely on a Windows machine. Debuggex will terminate lines depending on your system. So you would need \s\s to match both \r and \n

Interesting. That's very subtle behavior. (Especially since it sometimes fools one into thinking /g option is not enabled when in reality, it's a CR+LF issue.) I'm not saying your site's interpretation of Windows CR+LF is "wrong" but the other 5 online[1] regex testers don't behave that way on Windows Chrome browser. I also tested the regex and target text on desktop JGSoft RegexBuddy[2]. None of those required "\s\s…

Neither choice is great (the other ones that I've tried auto-convert \r\n to \n so it's impossible to test a \r\n string). I don't think there's anyone in particular that's at fault, \r\n causes a messy set of problems.
Post reply on HN