title: Splitting words in a variety of ways with Regex
body: <p>Working on something similar to Solr's <a href="https://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory" rel="nofollow">WordDelimiterFilter</a>, but not in Java. </p>
  
  <p>Want to split words into tokens like this:</p>
  
  <pre><code>P90X                 = P, 90, X (split on word/number boundary)
  
  TotallyCromulentWord = Totally, Cromulent, Word (split on lowercase/uppercase boundary)
  
  TransAM              = Trans, AM
  </code></pre>
  
  <p>Looking for a general solution, not specific to the above examples. Preferably in a regex flavour that doesn't support lookbehind, but I can use PL/perl if necessary, which can do lookbehind.</p>
  
  <p>Found a few answers on SO, but they all seemed to use lookbehind. </p>
  
  <p>Things to split on:</p>
  
  <ol>
  <li>Transition from lowercase letter to upper case letter</li>
  <li>Transition from letter to number or number to letter</li>
  <li>(Optional) split on a few other characters (- _)</li>
  </ol>
  
  <p>My main concern is 1 and 2. </p>