Live data from Hacker News

Regex that only matches itself

codegolf.stackexchange.com

61–66 of 66 posts

Re: Regex that only matches itself

#61
post #17

Earlier quoted context omitted.

> NOTE, delimiters must be included Your regex is actually /a/ which does not match the string "/a/".

I would say that adding slashes is quite arbitrary constraint, and it is really language specific syntax that is limited to minority of languages (I believe it was introduced in Perl). If you do regexp in Java, Python, C you don't use slashes. Edit: looks like slashes weren't even used in the example.

Perl's use of this syntax had ancestors in awk, sed, ed, and qed - originally just for string replacements in qed until Ken Thompson wrote a version that did regexps too. It dates back to 1967. https://www.bell-labs.com/usr/dmr/www/qed.html

Deutsch&Lampson's original paper on qed showing s/// used for string substitution prior to it gaining regexps is here: http://research.microsoft.com/en-us/um/people/blampson/04-On...

Incidentally the name 'grep' originated here, 'G/RE/P' was a qed command to do a Global Regular Expression match and Print the matches.

Re: Regex that only matches itself

#62

funny how many times this needed to be submitted before it stuck. https://news.ycombinator.com/from?site=stackexchange.com

Wow, and none of them even have [dupe] on them.

HN's story ranking system is undisclosed to prevent startups and/or VCs from gaming things AFAIK, but I'm wondering if it pushes things up based on time of day.

Alternatively, maybe the people who check /new are only around at certain times.

In any case, I'm definitely checking /new a lot more myself. Most of the things I've posted haven't "stuck" either, I realize just how many people this seems to be hitting.

Re: Regex that only matches itself

#63
post #3

I wish I was as smart as these people.

Everybody is a Genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein

I remember seeing this on Facebook and looking in to it. Turns out some fish do climb trees!

Also no evidence that Einstein said it. Indeed he seems to contradict the general idea behind it.

Not everyone is a genius. Being amazing at woodwork or running is not "genius", it's admirable but different. Some people are [intellectual/intelligent] geniuses, period. Not everyone is.

The best way to take this aphorism IMO is "don't stress out if you're a fish and you're no good at climbing trees, if your thing is swimming that's good too".

Re: Regex that only matches itself

#64
post #62

funny how many times this needed to be submitted before it stuck. https://news.ycombinator.com/from?site=stackexchange.com

Wow, and none of them even have [dupe] on them. HN's story ranking system is undisclosed to prevent startups and/or VCs from gaming things AFAIK, but I'm wondering if it pushes things up based on time of day. Alternatively, maybe the people who check /new are only around at certain times. In any case, I'm definitely checking /new a lot more myself. Most of the things I've posted haven't "stuck" either, I realize just…

>I'm wondering if it pushes things up based on time of day. //

What do you mean by that? I don't think HN sniffs location so hour would it even work with a global audience?

Re: Regex that only matches itself

#65

Earlier quoted context omitted.

If you know anything about regular expressions, perhaps considering yourself a fairly decent expert... you might even know how to write basic recursive regexes. Then you are like me and think you know how to begin ripping apart any regex. Then you see " \z|\1\Q^ \z|\1\Q>", and you can't even begin to parse it. For one, I didn't know you could add a quantifier to a recursive pattern. Then there is a backreference to w…

I didn't read that as trying to diminish the brilliance of the original accomplish, but just trying to frame it less as "magic" or "genius" that is incomprehensible and more as an impressive human feat by a human who had to do hard human work to get there. I believe the intent was to encourage us not to lessen the extent to which we believe that this is something that only a higher class of people can do. Ie: yes, we…

Thank you, that was indeed my intent here. I don't want to take away anything from the achievement, but you explained it better than I did.

Re: Regex that only matches itself

#66
post #62

Earlier quoted context omitted.

Wow, and none of them even have [dupe] on them. HN's story ranking system is undisclosed to prevent startups and/or VCs from gaming things AFAIK, but I'm wondering if it pushes things up based on time of day. Alternatively, maybe the people who check /new are only around at certain times. In any case, I'm definitely checking /new a lot more myself. Most of the things I've posted haven't "stuck" either, I realize just…

>I'm wondering if it pushes things up based on time of day. // What do you mean by that? I don't think HN sniffs location so hour would it even work with a global audience?

That is an incredibly good point, I certainly wasn't thinking clearly while I was figuring that out, hah

I remember seeing someone do some data analysis of all of HN and noted that there was a certain time of day that always seemed to be consistently upvoted the most. I think I was overextrapolating that data, especially considering I've no idea what the article was called now so I couldn't review it.

Post reply on HN