Live data from Hacker News

Regexper – Regular expressions visualizer

regexper.com

11–20 of 108 posts

Re: Regexper – Regular expressions visualizer

#12
Here is a regexp to match an IPv4 address - looks quite nice and easy to understand compared to the regexp! In fact the visualisation makes it easy to spot the mistake.

https://regexper.com/#'%5Cb((25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%...

(From https://stackoverflow.com/q/5284147/164234 )

Re: Regexper – Regular expressions visualizer

#14
post #13

Should I expect to have to to escape "/" as "\/"?

Complex regexes do render (must escape "/").

https://regexper.com/#%5B%5E%3C%5D%2B%7C%3C(!(--(%5B%5E-%5D-(%5B%5E-%5D%5B%5E-%5D-)-%3E%3F)%3F%7C%5C%5BCDATA%5C%5B(%5B%5E%5D%5D%5D(%5B%5E%5D%5D%2B%5D)%5D%2B(%5B%5E%5D%3E%5D%5B%5E%5D%5D%5D(%5B%5E%5D%5D%2B%5D)%5D%2B)%3E)%3F%7CDOCTYPE(%5B%20%5Cn%5Ct%5Cr%5D%2B(%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA-Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5B%20%5Cn%5Ct%5Cr%5D%2B((%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA-Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)%7C%22%5B%5E%22%5D%22%7C'%5B%5E'%5D'))(%5B%20%5Cn%5Ct%5Cr%5D%2B)%3F(%5C%5B(%3C(!(--%5B%5E-%5D-(%5B%5E-%5D%5B%5E-%5D-)-%3E%7C%5B%5E-%5D(%5B%5E%5D%22'%3E%3C%5D%2B%7C%22%5B%5E%22%5D%22%7C'%5B%5E'%5D')%3E)%7C%5C%3F(%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA-Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5C%3F%3E%7C%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regular expressions visualizer

#15
post #14
post #13

Should I expect to have to to escape "/" as "\/"?

Complex regexes do render (must escape "/"). https://regexper.com/#%5B%5E%3C%5D%2B%7C%3C (!(--(%5B%5E-%5D -(%5B%5E-%5D%5B%5E-%5D -) -%3E%3F)%3F%7C%5C%5BCDATA%5C%5B(%5B%5E%5D%5D %5D(%5B%5E%5D%5D%2B%5D) %5D%2B(%5B%5E%5D%3E%5D%5B%5E%5D%5D %5D(%5B%5E%5D%5D%2B%5D) %5D%2B) %3E)%3F%7CDOCTYPE(%5B%20%5Cn%5Ct%5Cr%5D%2B(%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA-Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D) (%5B%20%5Cn%5Ct%5C…

Horizontal scroll would be useful.

Re: Regexper – Regular expressions visualizer

#16
The Email::Valid Perl distribution ships with a more than 6000 character regex to validate E-Mail addresses.

Both goo.gl and bit.ly refused to shorten it, and when I tried to paste the link here HN refused to accept my comment.

But on a machine with Email::Valid installed do:

    perl -MEmail::Valid -wE 'say $Email::Valid::RFC822PAT'
And copy the output into the Regexper form. It takes a while to render, but it'll eventually complete.

Re: Regexper – Regular expressions visualizer

#20
post #6

Does not look like it supports negative lookbehind https://regexper.com/#(%3F%3C!a)b

It does do negative lookahead though - https://regexper.com/#%2F%5Cd%2B(%3F!%5C.)%2F

Negative lookbehind only appeared in Chrome in v.62 (https://v8project.blogspot.co.uk/2017/09/v8-release-62.html) it's not too surprising that tools haven't caught up yet.

Post reply on HN