Strategy Pattern too many if statements
<p>A user enters a code and the type of that code is determined by regular expressions. There are many different type of codes, such as EAN, ISBN, ISSN and so on. After the type is detected, a custom query has to be created for the code. I thought it might be a good idea to create a strategy for type, but with time it feels wrong.</p>

<pre><code>public interface SearchQueryStrategie {

    SearchQuery createSearchQuery(String code);
}
</code></pre>

<p>-</p>

<pre><code>public class IssnSearchQueryStrategie implements SearchQueryStrategie {

    @Override
    public SearchQuery createSearchQuery(final String code) {
        // Create search query for issn number
    }
}
</code></pre>

<p>-</p>

<pre><code>public class IsbnSearchQueryStrategie implements SearchQueryStrategie {

    @Override
    public SearchQuery createSearchQuery(final String code) {
        // Create search query for ISBN number
    }
}
</code></pre>

<p>-</p>

<pre><code>public class EanShortNumberSearchQueryStrategie implements SearchQueryStrategie {

    @Override
    public SearchQuery createSearchQuery(final String code) {
        // Create search query for ean short number
    }
}
</code></pre>

<p>-</p>

<pre><code>public class TestApplication {

    public static void main(final String... args) {
        final String code = "1144875X";

        SearchQueryStrategie searchQueryStrategie = null;
        if (isIssn(code)) {
            searchQueryStrategie = new IssnSearchQueryStrategie();
        } else if (isIsbn(code)) {
            searchQueryStrategie = new IsbnSearchQueryStrategie();
        } else if (isEan(code)) {
            searchQueryStrategie = new EanShortNumberSearchQueryStrategie();
        }

        if (searchQueryStrategie != null) {
            performSearch(searchQueryStrategie.createSearchQuery(code));
        }
    }

    private SearchResult performSearch(final SearchQuery searchQuery) {
        // perform search
    }

    // ...
}
</code></pre>

<p>I have to say that there are many more strategies. How should I dispatch the code to the right strategy?
My second approach was to put a boolean method into every strategy to decide if the code is correct for that strategy.</p>

<pre><code>public class TestApplication {

    final SearchQueryStrategie[] searchQueryStrategies = {new IssnSearchQueryStrategie(), new IsbnSearchQueryStrategie(),
            new EanShortNumberSearchQueryStrategie()};

    public static void main(final String... args) {
        final String code = "1144875X";

        for (final SearchQueryStrategie searchQueryStrategie : searchQueryStrategie) {
            if (searchQueryStrategie.isRightCode(code)) {
                searchQueryStrategie.createSearchQuery(code);
                break;
            }
        }
    }

    private SearchResult performSearch(final SearchQuery searchQuery) {
        // perform search
    }

    // ...
}
</code></pre>

<p><strong>How would you solve this problem? Is the strategy pattern the right one for my purposes?</strong></p>