Live data from Hacker News

RegExr: Learn, Build and Test Regex

regexr.com

21–30 of 52 posts

Re: RegExr: Learn, Build and Test Regex

#22

This one is my go-to. But it would be a lot better if it didn't display an alert when you try to leave the site. I've started to try and find alternatives.

In Firefox you can set dom.disable_beforeunload to true in your about:config to disable this behaviour (globally)

Re: RegExr: Learn, Build and Test Regex

#23

(I’m too much of an idealist for my own good.) I’m sure that these resources are great. And it’s not their fault that the regex family of languages evolved in the way that they did. But the simpler regex languages (without backreferences and other stuff… that I might not even know about) seem simple at first glance. In a perfect world I want to just spend and hour internalizing them forever. But in practice it seems…

> did I unintentionally use some metacharacter in this part of the string which I meant to be “fixed”? When in doubt, just throw a backslash in front of it, which always means "the next character is to be interpreted literally," even in cases where it's not necessary. (Well, not always; the backslash will invoke a special character when thrown before some letters; eg, "\t" means the tab character. But normal letters…

Fun fact: Rust's regex crate won't let you do this. If you try to escape a character that isn't a meta character, you get an error. So in cases like this, it will erase your doubt.

(There is ongoing discussion about relaxing this rule for some characters, since it is so common in some cases. For example, escaping / so common that folks try to do it with the regex crate and are surprised when it returns an error. / is rarely a regex meta character, rather, it tends to denote the start and stop of regexes, e.g., in Javascript or sed.)

Re: RegExr: Learn, Build and Test Regex

#26
post #5

RegExr is my go to tool for testing regex. It’s always been able to solve my needs and I’ve never had any need to change. In saying that, I’ve always wondered if regexr is missing out on something that other regex build/test tools have? What other regex tools do people use and why?

I typically use Regex101. It's been good enough for my needs and I'm just used to it at this point. Looking at RegExr, it seems like the only big difference is that Regex101 supports substitution, though I think I've only used it once. https://regex101.com/

What do you mean by substitution? Replacing a match with a string/pattern?

If so, RegExr does have that tool (at the middle/bottom, tools bar), and it probably is the functionality I most often use.

Re: RegExr: Learn, Build and Test Regex

#28
post #3

I (and most people I talk to about this stuff) tend to use Regex101 ( https://regex101.com ) for this purpose. It will be interesting to spend some time with RegExr and compare the two tools. I am also aware of RegexBuddy ( https://www.regular-expressions.info/regexbuddy.html ), whose author also publishes very good regex learning content on their site. It looks great, but it's a closed-source Windows-only applicatio…

https://www.regular-expressions.info/ is the best place to learn though, not because of the tools, but because the text is so good, so clear, you can learn without helper tools, just by reading, and become a regex master in one day.
Post reply on HN