26

When searching for a post, it is possible to filter the posts by a string that must be present in a block code, such as with code:"preg_match".  This search option is not documented, though.

Does this mean the option could be removed at any moment, or is it an option that is subject to changes?

5
  • 3
    Shhhh! It has been a while though, so I'm not sure if it's still "in-testing" or not.
    – Tim Stone
    Sep 12, 2012 at 19:08
  • 1
    Should I have titled the question "Shhhh! Why is the 'code:' […]"? ;)
    – apaderno
    Sep 12, 2012 at 19:11
  • 4
    @kiamlaluno That would attract less attention than "Eeeeeek! Why is the 'code:'..." Sep 12, 2012 at 19:16
  • 2
  • 1
    It's not a secret, but it's not polished either...I was interrupted in the middle of implementing it and haven't re-visited it in a while. You're welcome to use it and we won't remove it. That being said, I don't feel it's 1.0 quality at this point, so haven't added it to documentation as I expect there are bugs I'll find with more testing locally. We're doing a lot behind the scenes right now, when that settles down I'll re-visit search (we have lots of ideas/code in the pipe there). Sep 13, 2012 at 0:07

1 Answer 1

3

This has since made in into the Help Center article on searching:

To search only within code blocks: code:"new" to search code within posts for the word "new".

As far as I can tell, this was added at some point in May 2020, checking through the Web Archive to see when that line first appeared.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .