Regular Expression error messages
Is there any possibility to generate a readable error message after an failed match of regex pattern, to indeicate the index of the first character caused the non matching patter, something like this
"Character 5 must be a figit".
or is this not even possible to implement for regualr expressions?Thanks
Karim
[336 byte] By [
knassera] at [2007-10-2 3:00:42]

The interface java.util.regex.MatchResult (new in Java 5) has methods that provide this information:
"This interface contains query methods used to determine the results of a match against a regular expression. The match boundaries, groups and group boundaries can be seen but not modified through a MatchResult"
You can then throw your own error using the information. The end() method, specifically, will provide the information you want.