Fare icon indicating copy to clipboard operation
Fare copied to clipboard

System.InvalidOperationException: state

Open rawwool opened this issue 7 years ago • 4 comments
trafficstars

Xeger throws System.InvalidOperationException: state when trying to generate a string for this regular expression for emails: ^(?=.{6,50}$)([\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$

rawwool avatar Aug 22 '18 09:08 rawwool

Thank you for reporting this!

Project Fare turns Regular Expressions into Automatons by applying the algorithms of dk.brics.automaton and xeger.

Unfortunately, I don't have an answer to your question, as Project Fare is really a port of the above Java projects. – We'd have to try

^(?=.{6,50}$)([\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$

in Java and compare the results.

You may use a different pattern or use a different engine to reverse the Regular Expression into an Automaton. As an example, you can use the Rex engine.

moodmosaic avatar Aug 22 '18 09:08 moodmosaic