3 ms·
What do you think makes it better? I think the UX on rubular is much cleaner. Don't they both serve a different flavor of regex?
by anon3_ 11y ago
What do you think makes it better? I think the UX on rubular is much cleaner.
Don't they both serve a different flavor of regex?
- ghayes 11y agoFor me, it's lightning fast with no clutter. I just want quick verification that the regex I'm writing matches a few samples. Explaining to me that `+` matches "one or more of the preceding group" adds no value.
- bradleyland 11y agoRubular uses Ruby's regex engine (Oniguruma/Onigmo). Regexr uses your browser's RegEx engine. That doesn't make it "better", but it does mean they have slightly different purposes. You can use Ruby specific regex features with Rubular, so it is "better" for Ruby regex development. As a general principle, I like to test against the same regex engine that I'll use in production. If I'm writing Ruby, I'll use pry/irb or a tool like Rubular. If I'm writing Javascript, you'll find me in the closet with the barrel of a gun in my mouth... I mean, I'll test against my target browsers using their respective web inspector, or use a tool like RegExr. An example of the differences in the engines, the Onigmo engine supports conditional sub-patterns: Rubular: http://rubular.com/r/zUwSsIi117 http://rubular.com/r/zUwSsIi117 Regexr: http://regexr.com/3b1vn http://regexr.com/3b1vn As far as browsers go, they're actually pretty close most of the time. ECMA specifies regex (I think), so if you stick to the ECMA standard, you should be fairly safe. As with anything in browser-land, you'll encounter edge-case inconsistencies that will bite you in the ass.
- silentrob 11y agoRubular is my go to as well, even though I primarily write JS expressions and there are some gotcha. Having the numbered capture groups and clean simple interface is amazing. I also test and create tiny urls embedded in my code to show how the expression work. Handy for coming back later and making changes. I don't doubt there is something better, but it is still hard to change.