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]
# 1

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.

ChuckBinga at 2007-7-15 21:26:55 > top of Java-index,Administration Tools,Sun Connection...
# 2
it says the "results of a match" what I am looking for is sort of "user friendly description of the first cause of not having any matches. I am not very expreinced in regex but I have the feeling that it might not be possible at all?
knassera at 2007-7-15 21:26:55 > top of Java-index,Administration Tools,Sun Connection...
# 3
Read the API.
ChuckBinga at 2007-7-15 21:26:55 > top of Java-index,Administration Tools,Sun Connection...
# 4
I overlooked that it is new in Java 5, unfortunately I am using jdk 1.4 :(
knassera at 2007-7-15 21:26:55 > top of Java-index,Administration Tools,Sun Connection...