Live data from Hacker News

Show HN: Search code in GitHub repos using regular expressions

grep.app

81–90 of 165 posts

Re: Show HN: Search code in GitHub repos using regular expressions

#81

Earlier quoted context omitted.

The fact that you can’t search for file names is the funniest part to me.

You can but only in the repo itself not on a site wide scale.

Really? I searched for `filename:home.nix` (which brought me to https://github.com/search?utf8=%E2%9C%93&q=filename%3Ahome.n...). That seems site-wide to me, unless I'm misunderstanding you.

Re: Show HN: Search code in GitHub repos using regular expressions

#82
post #13

I do not have a great example to try on my phone, but are results deduplicated? That's my big peeve with GitHub search is getting 5 pages of the same forked repo.

There isn't any deduplication, although that will hopefully be less of an issue at this point since there's a limited number of repositories in the index.

Re: Show HN: Search code in GitHub repos using regular expressions

#84

^(. )'(. )'(. )$ I got a tooltip say: Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data Update:: Oh ^(. )"(. )"(. )$ works and fast.

I think that error was just because the server was overloaded - sorry about that.

Re: Show HN: Search code in GitHub repos using regular expressions

#86
post #81

Earlier quoted context omitted.

You can but only in the repo itself not on a site wide scale.

Really? I searched for `filename:home.nix` (which brought me to https://github.com/search?utf8=%E2%9C%93&q=filename%3Ahome.n... ). That seems site-wide to me, unless I'm misunderstanding you.

That's awesome. I didn't know about the keyword filename: I've been using the button to the left of "Clone or Download" this whole time. Thanks for the info!

Re: Show HN: Search code in GitHub repos using regular expressions

#88
post #57

Next post from danfox - “how to get 3 job offers in 3 hours”. Already has been publicly contacted by: - GitHub CTO - SerpApi CEO - SourceGraph CEO Search is hot right now!

Actually, It would more be like: "How I failed at 3 interviews, despite being directly contacted by execs."

Couldn't whiteboard a solution without the temp variable.

Re: Show HN: Search code in GitHub repos using regular expressions

#89

Why regex still exists? It is unintuitive, requires mastering an obscure syntax, it is very hard to debug, and very difficult to explain to others how it works. It feels like we are trying to write intermediate code by ourselves, while we should have a human readable language that generates regex.

You might be interested in “Eggex”, which aims to be a human-readable language that generates regexes. It’s currently written as a feature of the Oil shell, but in theory any tool could support them. Eggex docs: https://www.oilshell.org/release/latest/doc/eggex.html. Recent blog post about their development: https://www.oilshell.org/blog/2019/12/22.html.

However, Eggexes are a thin, mostly-syntactic layer over regexes. You still have to understand the regex engine to use them. If this sounds useless to you because you don’t currently understand any flavor of regex or parsing, I encourage you not to give up on learning regexes. (https://www.regular-expressions.info/ was how I learned; it’s a great tutorial.) Text-parsing engines, including regex engines, are a powerful concept that can be used in many situations, and I think it’s worth spending the effort learning them until, to paraphrase another commenter, regexes become the human-readable language you were searching for. Or Eggexes, at least.

Re: Show HN: Search code in GitHub repos using regular expressions

#90
post #88
post #57

Earlier quoted context omitted.

Actually, It would more be like: "How I failed at 3 interviews, despite being directly contacted by execs."

Couldn't whiteboard a solution without the temp variable.

I’m in a field and physical area with a pool so shallow - that it seems like straight up madness to throw questions like that at people and kick them out the door for it.
Post reply on HN