[Regexp] Finding out where/why isMatch failed
mitch-GNU RegExp List <[email protected]>
| Newsgroups | gmane.comp.gnu.regexp |
|---|---|
| Message-ID | <FCAD877FCDC934468792D53D3D0E7AFB021786@IGS001> |
Using the gnu.regexp package, is there a way to find out where in the input string the matching process failed? I envision an index or something that would show the first position in the input that could not be matched (or perhaps, but less useful, the last position that was successfully matched). Background: I use a system based on regular expressions to evaluate certain emails and make automatic status updates to a database based on the contents. Many times when the regular expression does not match (isMatch() == false) the problem is with the regular expression not the input. With some of the regular expressions being quite complicated it is often difficult or impossible to find out exactly where the mismatch occurred. Mitch Claborn