title: Regular Expression to Match " | "
body: <p>I am trying to use Java's <a href="http://www.ensta.fr/%7Ediam/java/online/jdk/150/api/java/util/Scanner.html#useDelimiter%28java.lang.String%29" rel="nofollow noreferrer"><code>useDelimiter</code></a> method on it's <code>Scanner</code> class to do some simple parsing. Basically each line is a record delimited by &quot; | &quot;, so for example:</p>
  <pre><code>2 | John Doe
  3 | Jane Doe
  4 | Jackie Chan
  </code></pre>
  <p>The method takes as a parameter a regular expression for which to match for. Can someone please provide me with the regular expression that would match <code>|</code> (A vertical bar separated by one space on both sides).</p>
  <p>Thanks, I would really appreciate it!</p>