Can I use a Regular Expression with Hashtable.containsKey(Object value);
Is there any way to do the following pseudo-code?
while ( myHashtable.containsKey(regex) ) {
//TODO
};
Where my regex would be “ERROR[0-9][0-9]?”
edit: I’m setting any number of error messages from a backend Java program which gets sent to the JSP as a hashtable. The JSP needs to display these error messages from the hashtable. Using the hashtable in the JSP is non-negotiable. I just need to know how to make sure we read all of the error messages.
Not in the way you’re suggesting.
Hash tables use an
Object‘shashCodeandequalsmethods to quickly find the object you are looking for.Instead you can iterate through the hash table’s elements and look for matches like this: