<p>Are you already familiar with the main algorithms in the area? Are you familiar with <a href="http://www.cs.ucr.edu/~stelo/pattern.html" rel="noreferrer">this site</a> a huge and well-maintained list of references in pattern matching?</p>

<p>I don't see how one could come up with a list of exercised for string matching, except "implement all main approaches and test them on a lot of data". And data is really easy to come by: you can grab any text file and it will do (you can create a positive example by seeking to a random location in the text file and getting n characters, and for a negative example any random string will do).</p>

<p>I'd read up on <a href="http://en.wikipedia.org/wiki/Knuth-morris-pratt" rel="noreferrer">KMP</a>, <a href="http://en.wikipedia.org/wiki/Boyer-Moore" rel="noreferrer">Boyer-Moore</a>, automata methods, and the naive algorithm and implement them, and then think about the problem trying to make your algorithms faster.</p>

<p>There is a huge literature in the area, of course, and the first link I posted can steer you in that direction.</p>

CC BY-SA 2.5
2010-08-16T21:33:36.650Z
2010-08-16T21:33:36.650Z
Alexandre Passos
<p>I would like to be somewhat good at string searching and pattern matching, could you point me to some good online resources? Exercise problems would be great. Thanks.</p>

CC BY-SA 2.5
2010-08-16T21:11:54.187Z
I have set this thread to community wiki from the get-go.
grokus
<ds.algorithms><string-search>
Best resources for string searching or pattern matching exercises
grokus
# Best resources for string searching or pattern matching exercises

(Asked by: username_0 on 2010-08-16)

I would like to be somewhat good at string searching and pattern matching, could you point me to some good online resources? Exercise problems would be great. Thanks.

**Tags:** ds.algorithms, string-search

> **Comments:**
> **username_0**: I have set this thread to community wiki from the get-go.  

---

## 1 answers

### Answer by username_1 on 2010-08-16. Score: 6 | Accepted answer

Are you already familiar with the main algorithms in the area? Are you familiar with [this site](http://www.cs.ucr.edu/~stelo/pattern.html) a huge and well-maintained list of references in pattern matching?

I don't see how one could come up with a list of exercised for string matching, except "implement all main approaches and test them on a lot of data". And data is really easy to come by: you can grab any text file and it will do (you can create a positive example by seeking to a random location in the text file and getting n characters, and for a negative example any random string will do).

I'd read up on [KMP](http://en.wikipedia.org/wiki/Knuth-morris-pratt), [Boyer-Moore](http://en.wikipedia.org/wiki/Boyer-Moore), automata methods, and the naive algorithm and implement them, and then think about the problem trying to make your algorithms faster.

There is a huge literature in the area, of course, and the first link I posted can steer you in that direction.


---

