in reply to Re: contest problem about shortest Regular expression
in thread contest problem about shortest Regular expression

Thank you for this resource, haven't read this book so far. In 6.5 chapter I found explanations how to generate string stream - to generate all strings which are covered by given regex, nice explaning schemes included. So it looks as an opposite problem.
  • Comment on Re^2: contest problem about shortest Regular expression

Replies are listed 'Best First'.
Re^3: contest problem about shortest Regular expression
by choroba (Cardinal) on Nov 29, 2017 at 10:48 UTC
    Ouch, you're right. I misread the assignment, I had the impression it wants the strings. OK, so you just want to optimize a finite automaton generated by joining all the input strings by | :-)

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      Yes, and I still don't know how to optimize (to shorten) such long regex to the minimal. And have no clear idea.