title: Sed: Searching for a string length and character specific
body: <p>I've been searching for a few hours now for a way to find a string containing 21 numeric characters and place a return in front of the string itself. Finally i found the solution using:</p>
  
  <pre><code>sed -r 's/\b[0-9]{21}\b/\n&amp;/g'
  </code></pre>
  
  <p>Works great!</p>
  
  <p>Now i have a new set of data containing 21 numeric characters but adding to that there is some alphabetic characters at the end of the string with a variable length of 3 to 10 characters.</p>
  
  <p>Sample input:</p>
  
  <pre><code>169349870913736210308ABC
  168232727246529300209DEFGHI
  166587299965005120122JKLMNOPQRS
  162411281984306600005TUVWXYZ
  </code></pre>
  
  <p>What i would like is to have a space between the numeric and the alphabetical characters:</p>
  
  <pre><code>169349870913736210308 ABC
  168232727246529300209 DEFGHI
  166587299965005120122 JKLMNOPQRS
  162411281984306600005 TUVWXYZ
  </code></pre>
  
  <p>Do note the 16 which every number starts with. I've tried using:</p>
  
  <pre><code>sed -r 's/^\b[0-9]{21}\+[A-Z]{3,10}\b/ /g' filename
  </code></pre>
  
  <p>But i couldnt get it to work because i dont know and couldnt find how to specifically search for a string containing an exact amount of numeric characters combined with alphabetical characters of a special length. I've found a lot of helpfull questions on this website, but this one i couldnt find. </p>