is there a way through regexp or regexp/syntax to know the last character
of a string that matched a regex?
I have a set of regular expressions like
"www.somesite.com/(?P<itemid>[0-9]+[A-Z][A-Z])/...". The regular
expressions are matched against urls entered by users through a web
When a regular expression matches, the url is valid and the code can work
on it. When it doesn't, the url is invalid.
I'd like to improve the interface to tell the user when the url is
incomplete, or where the error is in the url.
Thinking about it, I believe it would be relatively straightforward to
implement if, given a regexp, there was a way to know the last character
that matched in case of mismatch.
If the last character that matched is the last character of the url, then
the url is incomplete. I can just add some visual clues for the user to
If the last character that matched is somewhere in the middle, I can tell
the user "there's an error somewhere around here".
If multiple regexps match, I can tell the user "which url did you intend to
enter? those are the formats that are supported".
I can roll out my own parser most likely, but just using regexps seemed
nice. Any other suggestion on how to solve this problem?
Thanks for the suggestions,
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.