in reply to efficient method of matching a string against a list of substrings?
Then you can run through your hash, checking for the presence of the keys in your string. When a key is found, you look for its values. It might be something of an optimization to remember the pos where the key was found so your value searches could start there.$hash{'Ge'} = ['George', 'George Bush'];
Also, study might be your friend for this, if you use a regex rather than index.
|
|---|