On Monday 01 November 2004 01:42, John Carter wrote: [snip] > I would assume that deep inside you have translated the Regex into some > sort of finite automaton. > > What I would like is at the transition where the FA jams, it returns the > index to the char in the string it jammed on, and the range of chars for > which it would have accepted at that point. > > For example > /ab[cde]|ab(xy|yz)|ab_s/.try_match("abf") > should return something like... > "Jammed on index 2, character 'f' expected one of [cdexy_]" Interesting.. however I don't think its possible, because of backtracking. Though, I could do more logging of what is going on, so that one can inspect the sequence of events (lots of data). This is somehow related to maybe_match, which returns true as long as there is a chance for the regexp to match.. and false when there is no chance it can match. (maybe_match is not implemented.. but I expect to add it one day). -- Simon Strandgaard