Live data from Hacker News

Show HN: Regex Cheatsheet

ihateregex.io

21–30 of 135 posts

Re: Show HN: Regex Cheatsheet

#22
post #3

I'm loving the graphs which for the first time in years are giving me an idea of what an expression is actually doing. Just because the visualization is kept in a form that is easy to understand with a programming background but can also be translated to the expression itself in a straightforward manner.

I knocked up a silly dynamic regex grapher a while back as a little teaching aid - mildly fun

https://www.benf.org/other/regexview/

Re: Show HN: Regex Cheatsheet

#26

Is there a bug? In regexp for IPv4: https://ihateregex.io/expr/ip expression ends with {3} but the diagram states "2 times" in lower right - shouldn't it say "3 times"?

I think it says "repeat 2" times. So basically you'v already went through the group and then 2 more times.

Because if I specify x{0,3}, i have 2 paths - around x and thru x + at most 2 more times

Re: Show HN: Regex Cheatsheet

#30
post #11

This is really cool! 2 points: 1. it fiddled with my back button which is a bit annoying 2. a better email sample is ^[^@]+@[^@]+\.[^@]+$ which removes the 2 ampersands problem.

You'll probably want to add \S to those character classes as well, or it matches "it's an @ sign. not an ampersand."

Escaped or quoted whitespace is allowed in the local part of email addresses.
Post reply on HN