furl icon indicating copy to clipboard operation
furl copied to clipboard

Integers and float regexps

Open Drup opened this issue 10 years ago • 0 comments

The regexp for float and ints accept arbitrary big numbers and then parses them. If it's too big, it will fail (and not gracefully, at the moment)

I'm not sure what would be a good solution.

  • Using a regexp that matches only 32 bit integers, while possible, is a terrible idea.
  • Using zarith is a bit overkill (most application really don't care). And there is the javascript issue.
  • Wrapping int and floats in an option is really not user friendly.

The only good solution I see is to

  • Return None for extract. It forces the return type of extract to be an option (which should be the case anyway, but the types are not obvious to me just yet)
  • Trigger the default handler for match_url.

Maybe the kind of error encountered should be exposed to the user.

Drup avatar Apr 27 '15 13:04 Drup