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?

  • 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 '12 at 19:08
  • 1
    Should I have titled the question "Shhhh! Why is the 'code:' […]"? ;) – kiamlaluno Sep 12 '12 at 19:11
  • 4
    @kiamlaluno That would attract less attention than "Eeeeeek! Why is the 'code:'..." – Bill the Lizard Sep 12 '12 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). – Nick Craver Sep 13 '12 at 0:07
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 .