class YahooLookup implements LookupProvider {

	@VisibleForTesting
	protected static String parseTarget(String code) {
		Matcher forexMatcher = FOREX_PATTERN.matcher(code);

		if (forexMatcher.matches()) {
			String source = forexMatcher.group(1);
			String target = forexMatcher.group(2);
			return (target != null) ? target : source;
		}
		
		Matcher cryptoMatcher = CRYPTOCURRENCY_PATTERN.matcher(code);

		if (cryptoMatcher.matches()) {
			return cryptoMatcher.group(2);
		}

		return null;
	}

}