title: perl alternative for sed to split multiple |
body: <p>I was able to accomplish this in sed command, but could not get it working in perl. Would like to add spaces between pipe characters that are close together without any spaces or alphanumerics.</p>
  
  <pre>
  input           ==>  a|123|##||||
  expected output ==>  a|123|##| | | |
  </pre>
  
  <p>This <code>sed</code> command works fine:</p>
  
  <pre><code>echo "a|123|##||||" | sed 's/\([^[:blank:][:alnum:]]\)|/\1 | /g'
  </code></pre>
  
  <p>output for above command ==> <code>a|123|## | | | |</code></p>
  
  <p>In perl, I could not get it working</p>
  
  <pre><code>echo "a|123|##||||" | perl -pe 's/\([^[:blank:][:alnum:]]\)|/\1 | /g'
  </code></pre>
  
  <p>with output for above command</p>
  
  <pre>
  | a | | | 1 | 2 | 3 | | | # | # | | | | | | | | | 
  </pre>