<p>Suppose I've found a &ldquo;text&rdquo; somewhere in open access (say, on public network share). I have no means to contact the author, I even don't know who is the author.</p>

<p>What can I legally do with such &ldquo;text&rdquo;?</p>

<p><strong>Update:</strong> I am not going to publish that &ldquo;text&rdquo;, but rather learn from it myself.</p>

<p><strong>Update:</strong> So, if I ever see an anonymous code, article, whatever, shouldn't I even open it, because otherwise I'd copy its contents to my brain?</p>

As far as I
know
(without any legal training) - if you list the text or code or whathaveyou as "anonymous", you're OK.
I believe that by listing it as anonymous you're indicating you do not know where it came from, but you're admitting you didn't create it as original work.
Extending from that, you should be open to the actual author being able to prove they are the author, and changing your usage to reflect their name/license/copyright/whatever.
You should check with an Intellectual Property lawyer for details and corrections to my understanding.