John Maddock wrote:
With my undefined funtion I would obtain:
- Input text:"123 hello abc" - Latest rigth Regular expression: "(\d)+\s+(\w)+\s+" Matches: "123 hello " - First wrong regex: "(\d)+\s+(\w)+\s+(\d)+" does not match.
-> So, "(\d)+" does not match "abc"
I understand that usually this is not as easy as I write in my simple example because of the power of regular expressions but I think a function like that would improve a lot the error reporting capabilities. Is there any way to do what I need or I must to write my own check function?
That would indeed be useful: actually what we really need is a regular expression debugger, but both need a fully instrumented regex engine to associate states in the machine with characters in the original expression (so you know where the failure occurred).
I'm afraid there's no way to do what you want at present, it's always been on my TO-DO list, but never seems to have surfaced !
John. Does anyone know any application/utility that includes this feature (or a regular expression debugger)? At least this utility would be easier to define (and check) a regular expression against a difficult input.
Thanks anyway, Jordi