title: How to convert a PCRE to a POSIX RE?
body: <p>This interesting question <a href="https://stackoverflow.com/questions/2837267/">Regex to match anything (including the empty string) except a specific given string</a> concerned how to do a negative look-ahead in MySQL.  The poster wanted to get the effect of</p>
  
  <p><code>Kansas(?! State)</code></p>
  
  <p>because MySQL doesn't implement look-ahead assertions, a number of answers came up the equivalent</p>
  
  <p><code>Kansas($|[^ ]| ($|[^S])| S($|[^t])| St($|[^a])| Sta($|[^t])| Stat($|[^e]))</code></p>
  
  <p>The poster pointed out that's a PITA to do for potentially lots of expressions.</p>
  
  <p>Is there a script/utility/mode of PCRE (or some other package) that will convert a PCRE (if possible) to an equivalent regex that doesn't use Perl's snazzy features?  I'm fully aware that some Perl-style regexes cannot be stated as an ordinary regex, so I would not expect the tool to do the impossible, of course!</p>