how to encode String into Pattern and retrieve the String
<p>Question closed because I misunderstood the situation. To show my stupidity though, I'll not remove what I wrote.</p>

<p>I'd like to encode a piece of string into Pattern, and get the string back.</p>

<p>I tried:</p>

<pre><code>String s = buff.readLine();
Pattern p = new Pattern(s);
</code></pre>

<p>and use the following to retrieve my string</p>

<pre><code>System.out.println(p.toString());
</code></pre>

<p>But it didn't work, the output is just the "package name@(some random things)... I tried <code>Pattern p = Pattern.compile (s);</code> 
but I got an error from the compiler.</p>
