How to use Regex as a key in Hashmap to match the given string with key in java
I have a table which contains list of regular expression and its corresponding value.I have to fetch those value and put it HASHMAP where regex as key.I have to compare the each key with the given string(input) and If matches I have to get the corresponding Value for the regex.
Your help is highly appreciated.
Thank you in advance
Re: How to use Regex as a key in Hashmap to match the given string with key in java
What have you tried?
Can you give some examples? If a regex is a pattern that is matched against a String, couldn't there be many Strings that match?
list of regular expression and its corresponding value