In order to avoid an exception, you have to use the regex twice, once before calling the constructor and once in the constructor just to be sure (the constructor calls it for you). It would be better if there were some way to only call the regex once and get an Option[JNumber] out.
In order to avoid an exception, you have to use the regex twice, once before calling the constructor and once in the constructor just to be sure (the constructor calls it for you). It would be better if there were some way to only call the regex once and get an
Option[JNumber]
out.