From: jacbs loaru Date: 2012-07-15T00:14:59+09:00 Subject: What is done by Ruby i was thinking of using the "string".start_with? method in reverse such as "moc.elpmaxe.niamodnropbus".start_with?(["moc.elpmaxe", ...]) with the list of domains as a prefix.. but there is one problem: i cant match all the domains as prefix because some of them are not a prefix but an exact match. so i will need to do some code like this: > i have a list of domains and i want to apply acl such as ".example.com" will > match all domains that starts with "example.com". > but the problem is that domain start in a reverse order. > i was thinking on what is the best\better way to match a domain to domain > list ? If in memory (which does not seem to be the case here) I would create a forest for matching with TLD's as root level: -- Posted via http://www.ruby-forum.com/.