Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!

Chris Rudd

Greenhorn
+ Follow
since Nov 22, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris Rudd

I would tend to agree with John here - especially since the methods were previously abstract.
11 years ago
Did you check the Java Compiler settings under the Project -> Properties menu?
11 years ago
There are some capitalization errors and a few braces misplaced or omitted. Try this:

11 years ago
I think you have a few problems here.

The first is that the string "a-z" does not match characters from a-z. In order to do that, it must be enclosed in brackets like [a-z].

Also, the dot "." must be escaped with a slash "\" - which in a Java String must also be escaped. Thus, to match a dot, you need "\\."

Finally, your group of optional terms will only match one character - you need a quantifier such as * (for zero or more matches) or a + (for one or more matches).

I'm no expert on regular expressions, but I always find this site helpful:
http://www.regular-expressions.info

As for the actual regex, you might want to try something like:



/edit
If you don't care what the version number format is, I would go with Henry's suggestion.

[ November 30, 2006: Message edited by: Chris Rudd ]
[ November 30, 2006: Message edited by: Chris Rudd ]
11 years ago
I am no expert at this, but here is my understanding:

In order for a class to be "unloaded", its ClassLoader must be destroyed. If you are using the SystemClassLoader, then I would say destroying it would be rather difficult. If you load your external classes with a separate URLClassLoader, then you can destroy and reload at will.

Heck, you should be able to load multiple implementations of the same class with different URLClassLoaders concurrently.

Or maybe I'm crazy.


Chris
11 years ago
I think your problem lies in the use of the Scanner class. From my understanding, this class basically serves as a tokenizer. The default delimiter is whitespace. The call to



is checking to see if the next token matches your regular expression. The first token it checks from the input



is [Wed. This is why your first test is passing. The extended regular expression does not match this token, so it is failing.

I think what you are looking for is something like the following:



Although I'm not sure a regex test like this is the best way to go about validating a date (but then again, I'm not sure if that is what you are after).

Hope this helps.


Chris
[ November 22, 2006: Message edited by: Chris Rudd ]
11 years ago